Python Coding- Except ValueError Using Except ValueError, change the program so that if the user inputs something other than "Y" or "N", the program will print to the counsole "Please input Y or N" and re-ask if the user would like the instructions. Here is the coding: def ins():print("There are 23 cases, containing amounts of money varying between $1 and $25k!") print("Type 'Y' for yes or 'N' for no.")userInstruction=input("Do you want instructions on how to play?").upper() if userInstruction=="Y":ins()elif userInstruction:print("OK! Let's begin!")winsound.Beep(345, 500)time.sleep(0.5)else:print("Please input 'Y' or 'N'.") Thank you!
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Python Coding- Except ValueError
Using Except ValueError, change the program so that if the user inputs something other than "Y" or "N", the program will print to the counsole "Please input Y or N" and re-ask if the user would like the instructions.
Here is the coding:
def ins():
print("There are 23 cases, containing amounts of money varying between $1 and $25k!")
print("Type 'Y' for yes or 'N' for no.")
userInstruction=input("Do you want instructions on how to play?").upper()
if userInstruction=="Y":
ins()
elif userInstruction:
print("OK! Let's begin!")
winsound.Beep(345, 500)
time.sleep(0.5)
else:
print("Please input 'Y' or 'N'.")
Thank you!
Trending now
This is a popular solution!
Step by step
Solved in 1 steps