Class 7
Class 7
ex:-
>>> s = 'scodeen'
10--->int
'scodeen'--->str
10.5--->float
ex:-i.low level programming lang.i.Insertion order are preseved.
ii.hetrogeneous object are allowed.
iii.duplicates are allowed.
iv.Growable in nature.
v.values should be enclosed within squre bracket.
1.Arithmetic Operators
2.Relational or comparision operatos
3.Logical OperatosNote:- raw_input functi
x = eval(input('First number:'))Note:- But in python3 we have only input() method
and eaw_input() method is not available.
python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.
python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.
y = eval(input('second number'))
print(x+y)
But in python3 we have only input() method and eaw_input() method is not available.
python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.
10--->int
'scodeen'--->str
10.5--->float
Note:- But in python3 we have only input() method and eaw_input() method is not
available.
python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.
Note:- raw_input function of python 2 is renamed as input() function in python3.
Output:-
10--->int
'scodeen'--->str
10.5--->float
Note:- But in python3 we have only input() method and eaw_input() method is not
available.
python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.
Output:-
python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.
Note:- But in python3 we have only input() method and eaw_input() method is not
available.
python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.
10--->int
'scodeen'--->str
10.5--->float
Note:- But in python3 we have only input() method and eaw_input() method is not
available.
python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.
by using single quotes or double quotes we can not represent multiline string
literals,so that for the multiline string we are using triple quotes.
def whtsapp_setting_dept(self):
a.self = a
slicing of strings.
slice means a piece.
[] operators is called slice operator,which can be used ti retrive parts of string.
Rules:-
variable [start:end+1:steps]
>>> s = 'scodeen'
>>> s[0]
's'
>>> s[-1]
'n'
>>> s[6]
'n'
>>> s[0:3]
'sco'
>>> s[0::2]
'soen'
>>> s[-0]
's'
>>> s[0::]
'scodeen'
>>> s[0::2]
'soen'
>>> s[0:5:2]
'soe'
>>>
ans:- dir()