204k views
3 votes
Write a program that accepts a whole number as input, multiplies that number by 12, and then outputs the product.

Hint: Remember that to think about the data type that the user will input. How can you make sure that their input is entered as a number?

User Netorica
by
3.2k points

1 Answer

2 votes

Step-by-step explanation:

userInput = input("Enter Number")

try:

val = int(userInput)

except ValueError:

print("That's not an int!")

User Dowhilefor
by
4.1k points