Numbers:
a) integers: int
b) booleans bool(0) - False bool(1) - True
c) floating point numbers: float
d) complex numbers: a= 0+3.1j b=1.5+2j
Strings:
String is a sequence of characters can be individually accessed using its index
subject="Computers"
subject
'Computers'
subject[-9]
'C'
List
a=[1,2,3,4,5]
print(a)
Tuples:
p=(1,2,3,4,5)
Value of type list are mutable i.e. changeable- one can change/delete/add a list's elements. But the values of type tuple are immutable i.e. non-changeable:
Dictionary:
It is an unordered set of comma-separated key:value
a) integers: int
b) booleans bool(0) - False bool(1) - True
c) floating point numbers: float
d) complex numbers: a= 0+3.1j b=1.5+2j
Strings:
String is a sequence of characters can be individually accessed using its index
subject="Computers"
subject
'Computers'
subject[-9]
'C'
List
a=[1,2,3,4,5]
print(a)
Tuples:
p=(1,2,3,4,5)
Value of type list are mutable i.e. changeable- one can change/delete/add a list's elements. But the values of type tuple are immutable i.e. non-changeable:
Dictionary:
It is an unordered set of comma-separated key:value
No comments:
Post a Comment