In [ ]: #Python is a dynamically typed programming language coz no need to specify datatype every time we assign a value to a variable
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 [ ]: #### 1. Str Datatype
#[Link] character of str datatype can be accessed by []
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'
In [19]: a="datavizon" # Extract data
a[0:4] #start:end, end will be excludedd, Always end with end+1
Out[19]: 'data'
In [20]: a="Engineering" # Extract engineering
a[0:8]
Out[20]: 'Engineer'
In [22]: a="KSR Datavizon" # Extract data
a[4:8]
Out[22]: 'Data'
In [23]: a="KSR is the best Institute" # Extract The best
a[7:15]
Out[23]: 'the best'
In [24]: a="Python is my fav language" # Extract my fav
a[10:16]
Out[24]: 'my fav'
In [27]: a="datavizon" # extract dtvzn using step i.e (start:end:step)
a[0:9:1] # datavizon
a[0:9:2] #dtvzn
Out[27]: 'dtvzn'
In [28]: a="santhosh" #extract snhs
a[0:7:2]
Out[28]: 'snhs'
In [29]: a="dataengineering" #extract dag
a[0:7:3]
Out[29]: 'dag'
In [2]: a= "python" # Extract po
a[0:5:4]
Out[2]: 'po'
In [13]: #### Supportive function for string datatype
a ="Sunil"
In [2]: [Link]() #### convert the string into uppercase
Out[2]: 'SUNIL'
In [3]: [Link]() #### convert string into lowercase
Out[3]: 'sunil'
In [4]: [Link]() ### Convert first letter into uppercase
Out[4]: 'Sunil'
In [5]: [Link]() ####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'
In [8]: [Link]() ####Check if it is a numeric value
Out[8]: False
In [9]: [Link]() #### check if it is an alphabet
Out[9]: True
In [12]: [Link]() ### 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]: [Link]()
Out[20]: True