Python Training Notes
Python Training Notes
Python introduction:
· Data types: int, float, bool, string,complex
KEYWORDS:(32)
or not is if
priority: **(exponential)
* / % //(floor)
+ -
2)Assignment: =,:=
5)Compound: +=,,-=,*=,/=,%=
>>(a>>b ===a/(2^b))
7)Membership: in , not in
8)Conditional statements:
3) data stuctures:
· List
· Tuple
· Set
· Dictionary
4)iterative statements:
a)while (condition):
statement 1
staement 2........
class Solution(object):
if n<=0:
while n%3==0:
n//=3
return n==1
# keyword.kwlist
Number Systems :
· decimal
· hexa decimal
inputs:
0b1010 binary
0o123 octal
0xFF hexa
0XF decimal
character:
chr(122) === z
class Solution(object):
"""
:rtype: bool
"""
orig=num
rev1 =0
rev2=0
rem=0
while num!=0:
rem=num%10
rev1 = rem+ rev1*10
num=num//10
num=rev1
while num!=0:
rem=num%10
num=num//10
if(orig==rev2):
return True
else:
return False
OR