Question: Could somebody explain to me why my program isn't running properly (bear in mind we're not allowed to use break/continue statements). I need the loop

Could somebody explain to me why my program isn't running properly (bear in mind we're not allowed to use break/continue statements). I need the loop to continue iterating until the user has either entered lowercase/uppercase 'y'/'n' using a while loop.  Could somebody explain to me why my program isn't running properly
(bear in mind we're not allowed to use break/continue statements). I need

1 2 # Set an initial value for program to perform calculations restart = 'Y 4 # FLAG swhile restart == 'y' or restart == 'Y": B 9 # DUMMY PROGRAM X = 7 + 11 print('7 + 11 = {x}') # DUMMY PROGRAM e 13 15 16 17 18 # Ask the user if they want to perform the calculations again, accept y only white restart != ('n', 'N') or restart != ('Y', 'Y'): # Ask user if they want to perform the calculation again(accepty or only) restart = input('Would you like to restart the program(y)? ') # Terminate program if restart == 'n' or restart == 'N': print('Thank you for being a loyal customer, have a great day!") # Run dumny program again elif restart == 'y' or restart == 'Y': print('Running again) # Keep asking user to enter a valid entry (Lowercase/uppercase 'y' or 'n') using a while loop else: print('Invalid response') 19 28 22 23 7 + 11 = 18 Would you like to restart the program(y)? 10 Running again Would you like to restart the program(y)? n Thank you for being a loyal customer, have a great day! Would you like to restart the program(y)? d Invalid response Would you like to restart the program(y)? q Invalid response Would you like to restart the program(y)? Invalid response Would you like to restart the program(y)? y Running again Would you like to restart the program (y)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!