# Page 11 math operations # Page 12 variables x = 7 # x var name int data type 7 value assigned # = assignment # == in equality to # === strictly in equality to y = 3 z = x + y print(z) # print() variable value for z # Page 13 multiple variables x,y,fname,vipStatus = 10,5,"Bob",True # x = 10 and y = 5 being pythonic z = x + y print(z) # 15 print(fname) # Page 14 strings fname = "Bob" # string lname = 'Smith' # string prefered in Python fullname = fname + ' ' + lname print(fullname) # Escape the logic of the code for ONE literal char # Page 15 sentence = 'Bob\'s last name is Smith' # 2of the single quotes are logical string and 1 is the literal single quote print(sentence) # length of the string FL, IA, NY 'data set' lengthoffname = len(fname) # len() page 16 print(lengthoffname) # 3 # Page 17 input() ALWAYS types as string firstName = input("Enter your first name: ") # input() lastName = input("Enter your last name: ") result = "You entered " + firstName + " " + lastName + " as your full name." print(result) # Page 18 - 20 booleans and if keywork age = int(input("Enter your age: ")) # int(string) casting page 17 if age < 18: # True print("You can note vote.") elif age >= 18 and age < 21: # Retesting the False with ANOTHER condition print("You can vote but not drink.") elif age >= 21 and age < 72: print("You can vote and drink, but not retire.") else: # False AFTER all conditions are testing print("You can vote and drink and retire.") # while keyword page 20 # condition, control, expression or operation # control variables OUTSIDE of the Loop i = 1 # control while i < 10: # condition print(i) # operation print() # i = i + 1 addition operator i += 1 # increment by 1 # for keyword page 21 for char in "Matusiak": # len(8) print(char)