3.python Datatypes
3.python Datatypes
In [2]: a= "sunil"
type(a)
Out[2]: str
In [3]: b= 13
type(b)
Out[3]: int
In [4]: c= 3.17
type(c)
Out[4]: float
In [6]: d = True
type(d)
Out[6]: bool
In [ ]: # Datatypes
1. str
2. int
3. float
4. bool
In [9]: a="sunil"
print(a)
type(a)
sunil
Out[9]: str
In [16]: b="sunil_lambe"
b[0]
b[5]
b[9]
Out[16]: 'b'
Out[19]: 'data'
Out[20]: 'Engineer'
Out[22]: 'Data'
Out[27]: 'dtvzn'
Out[28]: 'snhs'
Out[29]: 'dag'
Out[2]: 'po'
a ="Sunil"
Out[2]: 'SUNIL'
Out[3]: 'sunil'
Out[4]: 'Sunil'
In [5]: a.casefold() ####used to normalize a string to a case-insensitive form. It is similar to the lower() method
####but is more aggressive in handling different Unicode characters
Out[5]: 'sunil'
Out[8]: False
Out[9]: True
In [12]: a.isalnum() ### to check if the characters in the string are alphanumeric, if not(i.e has spaces, special characters shows flase)
Out[12]: False
In [19]: b='314'
In [20]: b.isnumeric()
Out[20]: True