valid = False
while not valid:
try:
n=int(input("Enter a number"))
while n%2==0:
print("Bye")
valid = True
except ValueError:
print("Invalid")
a) Bye (printed once)
b) No output
c) Invalid (printed once)
d) Bye (printed infinite number of times)
What will be the output of the following Python code if the input entered is 6?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What will be the output of the following Python code if the input entered is 6?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!