The document introduces Python as a simple, beautiful, and easy to learn programming language. It is open source and can be used for tasks like text handling, system administration, GUI programming, web applications, databases, scientific applications, games, and natural language processing. Python has a simple syntax without semicolons and uses indentation for code blocks. It supports object oriented programming, functions, modules, exceptions, and many data types including lists, tuples, dictionaries, strings and files. The document provides examples of basic Python concepts and how to use built-in modules, create your own modules, handle files, integrate with databases, and build graphical user interfaces.
1 of 105
More Related Content
python-an-introduction
1. Python An Introduction
Shrinivasan T
tshrinivasan@gmail.com
http://goinggnu.wordpress.com
14. Python is...
A dynamic,open source programming
language with a focus on
simplicity and productivity. It has an
elegant syntax that is natural to read and easy
to write.
15. Quick and Easy
Intrepreted Scripting Language
Variable declarations are unnecessary
Variables are not typed
Syntax is simple and consistent
Memory management is automatic
33. for i in range(1, 5):
print (i)
print('The for loop is over')
34. number = 23
running = True
while running :
guess = int(input('Enter an integer : '))
if guess == number :
print('Congratulations, you guessed it.')
running = False
elif guess < number :
print('No, it is a little higher than that.')
else:
print('No, it is a little lower than that.')
print('Done')
37. List = Array
numbers = [ "zero", "one", "two", "three",
"FOUR" ]
numbers[0]
>>> zero
numbers[4] numbers[-1]
>>> FOUR >>> FOUR
numbers[-2]
>>> three
38. Multi Dimension List
numbers = [ ["zero", "one"],["two", "three",
"FOUR" ]]
numbers[0]
>>> ["zero", "one"]
numbers[0][0] numbers[-1][-1]
>>> zero >>> FOUR
len(numbers)
>>> 2
68. class Person:
def __init__(self, name):
#like contstructor
self.name = name
def sayHi(self):
print('Hello, my name is', self.name)
p = Person('Arulalan.T')
p.sayHi()
Classes
74. poem = ''' Programming is fun
When the work is done
if you wanna make your work also fun:
use Python!
'''
f = open('poem.txt', 'w') # open for 'w'riting
f.write(poem) # write text to file
f.close()