Untitled
unknown
plain_text
4 years ago
2.4 kB
6
Indexable
#HW Wk 4 specialUser = False import sys q1 = 'What is your favorite sugary or salty snack?' q2 = 'If you have one, what is your favorite emoji?' q3 = 'What is your favorite podcast?' print ('What is your name?') myName = input() print ('\n') if myName == 'Salette': specialUser = True if specialUser == True: print ('Hello ' + myName + '!' ' It is nice to meet you.') print ('I have 3 questions for you...') print ('\v') print ('Question 1: ' + (q1)) a1 = input() print ('\v') print ('Question 2: ' + (q2)) a2 = input() print ('\v') print ('Question 3: ' + (q3)) a3 = input() print ('\v') print ('Thanks ' + myName + '!' ' Here are the questions along with your answers...') print ('\v') print ('Question 1: ' + q1) print ('Answer: ' + a1) print ('Question 2: ' + q2) print ('Answer: ' + a2) print ('Question 3: ' + q3) print ('Answer: ' + a3) print ('Thanks for playing with me') sys.exit() else: print('Ok you can play with me but the length of your answers must be more than 10 characters.') print ('Hello ' + myName + '!' ' It is nice to meet you.') print ('I have 3 questions for you...') print ('\v') print ('Question 1: ' + (q1)) a1 = input() print ('\v') while (len (a1) < 10): print("Your answer must be more than 10 characters - please try again") a1 = input() print ('Question 2: ' + (q2)) a2 = input() print ('\v') while (len (a2) < 10): print("Your answer must be more than 10 characters - please try again") a2 = input() print ('Question 3: ' + (q3)) a3 = input() print ('\v') while (len (a3) < 10): print("Your answer must be more than 10 characters - please try again") a3 = input() print ('Thanks ' + myName + '!' ' Here are the questions along with your answers...') print ('\v') print ('Question 1: ' + q1) print ('Answer: ' + a1) print ('Question 2: ' + q2) print ('Answer: ' + a2) if (len (a2) < 10): print("Your answer must be more than 10 characters - exiting program") sys.exit() print ('Question 3: ' + q3) print ('Answer: ' + a3) if (len (a3) < 10): print("Your answer must be more than 10 characters - exiting program") sys.exit() print ('Thanks for playing with me')
Editor is loading...