Question: Can someone help me with my python code? I want the code to exit the loop if the user enters a c or s. If

Can someone help me with my python code? I want the code to exit the loop if the user enters a c or s. If the user enters an invalid character, an error message will be displayed and it will ask the user to enter another character until it is a c or s. Thank you

type = str(input("Enter the type of account [C/S]: ")) while (type != 'C' or type != 'S'): print("Enter C or S") type = str(input("Enter the type of account [C/S]: ")) print("Yay!")

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!