0 of 2 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 2 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Will this code be able to run?
while True:
try:
number = int(input(“Enter a whole number: “))
except ValueError:
print(“That is not valid number”)
else:
print(str(number) + ” is a cool number”)
break
This is from the same code as the previous question, but if you were to switch the ValueError to NameError will it run smoothly if a string was entered?
while True:
try:
number = int(input(“Enter a whole number: “))
except NameError:
print(“That is not valid number”)
else:
print(str(number) + ” is a cool number”)
break