Python
Python
Python
• Python is Interactive − You can actually sit at a Python prompt and interact
with the interpreter directly to write your programs.
print counter
print miles
print name
Python data types, objects and other
statements
• Variables:
Multiple Assignment:
a=b=c=1
a,b,c = 1,2,"john"
Python data types, objects and other
statements
• Standard Data Types:
Python has five standard data types :
– Numbers
– String
– List
– Tuple
– Dictionary
Python data types, objects and other
statements
• Standard Data Types:
Numbers:
Python supports four different numerical types −
– int (signed integers)
– long (long integers, they can also be represented
in octal and hexadecimal)
– float (floating point real values)
– complex (complex numbers)
Python data types, objects and other
statements
• Standard Data Types:
Numbers:
Here are some examples of numbers −
dict = {}
dict['one'] = "This is one"
dict[2] = "This is two"