sum = 20.5
x = 9
z = x + 5
x = 20*x + 22
print(sum)
print(z)
print(x)
s = 'Tony'
t = "John's Tavern"
u = '''
hello
how are you?
'''
print(s)
print(u)
b1 = True
b2 = False
print(b1,b2)
print(x/5)
print(x//5)
print(x%5) # this is the modulus operator
numlist = [ 10, 20, 30, 40, 50 ]
namelist = ["john","tony","anna"]
emptylist = []
print(numlist)
print(emptylist)
numlist.append(60)
print(numlist)
print(numlist[1], numlist[-5])
print(numlist.index(50))
numlist2 = [ 10, 20, 50, 40, 50 ]
numlist2.index(50)
numlist2[2:4] # slice
numlist2[2:5]
numlist2[2:]
numlist2[:4]
True and True
True or False
not True
x
x > 200 # >, >=, <, <=, ==, !=
x != 202
if x > 200:
print("x more than 200")
print("hahaha")
else:
print("x is not more than 200")
print("ohohoh")
if x < 200:
print("x more than 200")
print("hahaha")
else:
print("x is not more than 200")
print("ohohoh")
range(10)
list(range(0,10))
list(range(10,20))
list(range(10,20,2))
len(numlist2)
list(range(len(numlist2)))
numlist2 = [10,20,30,40,50]
for x in numlist2:
y = x+x
print(x,y)
for index in range(len(numlist2)):
print(index,numlist2[index])
s = "Hello, How are you?"
s[3:5]
s[5]
for x in s:
print(x)
len(s)
d1 = { "john": 23, "tony": 32, "anna": 22}
d1["john"]
d1["anna"]
print(d1)
for x in d1:
print(x,d1[x])
d1["raj"] = 62
print(d1)
d1["anna"] = 42
print(d1)
d2 = { "raj": [7, 17, 27], "jim": [1,2]}
d2["raj"]
len(d2["jim"])