Interactive Session: Start Python Shell * Comments * Typeless v = 1.2 type(v) v = "hi" type(v) * Case Senssetive myvar = 10 myvar Myvar Myvar = 2 * Whitespaces for i in range(10): print i print bye for i in range(10): print i print bye ==== Variables === a = 10 b = "hi" a + b = 2 # NOT 2a = "Hi # NOT _hi = "hi" YAY thisIsMyVariable = "hi" this_is_my_variable = "hi" === Operators === a = "hi" a + a a*10 a = 2 a + a a + 10 === Data Type ==== q = True if (2 > 0) == q: print "true" w = false q == 1 q == 0 w == 0 === Numbers === Integers Float q = 10 # Integer w = 20.2 Float 20 / 7 >> 2 # round 20 / 7.0 # Works great hexadecimals === Strings === q = 'Hello what a lovely day' q[0] # 1-2-3 q[4:10] #Selection q[:10] # Start from 0 q[-1] # 1-2-3 q[1:2] len(q) q.find("q") q.find("y") q.rfind("y") "lovely" in q q.upper() q.lower() "hello" in q >> ERR "hello" in q.lower() >>True for i in q: print i q.split() q.title() === Lists === w = q.split() len(w) for i in w: print i w[0] w[0::2] #GoBack " ".join(w) q.title()[-3:] q.title()[-3:].upper() ===python tuples=== w = [1,2,3,4] # list e = (1,2,3,4) 3 Tuple w[0] = 10 #change value of list w e[0] = 10 # X w.append(6) w e.append(6) #Tuple does not work #Cool function dir(q) help(q.title) === Dictionary or Hashmaps === can be though as a lit r = {"name":"Hashim', "lastname":"Thaci", "age":45} r r['age'] r["name"] r['name'].upper() r.keys() r.values()