#This is a comment #There is no ; in python print(8) #integer value print("8") #string value, see no difference ''' This is a multiline comment try to type these directly in shell to see the differences 8 "8" ''' print(type(8)) print(type("8")) ''' try to type these directly in shell to see the differences type conversion str(8) int("8") 6 + int("20") # integer "6" + "20" #string 6 + "20" #error why? ''' x = 20 print(x) #variable x print("x") #string print('x') #string print("----------------") a, b, c = 20, -45, 30 print('a =', a ,'b =', b ,'c =', c) print("----------------") a = 20 b = 30 c = 40 a = 50 print('a =', a) #why? print('b =', b) print('c =', c) print("----------------") #delete variable del a, b #cannot print a & b anymore #Python has rules for variable names - etc. google it, it is every where #floating point numbers, there is a range x = 18.827498372418273987483274 print(x) #15 digits only print("----------------") x = 38.65 print(x) x = int(38.65) print(x) x = round(38.65) print(x) x = round(38.15) print(x) print("----------------") x = 38.1237455 x = round(x, 3) print(x) x = 438.1237455 x = round(x, -1) print(x) print("----------------") # \ escape symbol # \n new line # \t tab # \b backspace, only works in command shell # \a alert, only works in command shell print('line 1\nline 2\nline 3') print('Tab 1\tTab 2\tTab 3') print("Famous quote \"Whatever you are, be a good one. Abraham Lincoln\"")