try:
num = int(input("Enter your age: "))
except ValueError:
print("That's not a number!")
Which of the following is the correct way to format a try block in Python?
(1 point)
Responses
try {
num = int(input("Enter your age: "))
except ValueError:
print("That's not a number!")
try { num = int(input("Enter your age: ")) except ValueError: print("That's not a number!")
try:
num = int(input("Enter your age: "))
except ValueError:
print("That's not a number!")
try: num = int(input("Enter your age: ")) except ValueError: print("That's not a number!")
try: num == int(input("Enter your age: "))
except ValueError: print("That's not a number!")
try: num == int(input("Enter your age: ")) except ValueError: print("That's not a number!")
try:
num = int(input("Enter your age: "))
accept ValueError:
print("That's not a number!")
1 answer