idjfjcjs7291 idjfjcjs7291
  • 02-12-2022
  • Computers and Technology
contestada

Write a program that accept a whole number a input, mutiplie that number by 21, and then output the product

Respuesta :

candlejenner candlejenner
  • 03-12-2022

Answer:

while True:

   try:

       whole_number = int(input("Enter a whole number: "))

       break

   except ValueError:

       print("That is not a whole number. Try again.")

product = whole_number * 21

print("The product is", product)

Explanation:

using while true and except ValueError to make sure the user enters a whole number

Answer Link

Otras preguntas

Describe the changes in western society that gave rise to the city geography and ecology
What is the second longest river in Africa?
What's a good way of showing someone that you're sorry ?
if you live in the southern hemisphere what season do you have in august
A candidate for mayor wants to know how strong her support is among voters, so she posts an online survey on her campaign website for voters to take. Is this sa
For Christians, should the motivation of taking care of the Earth be different than non-Christians? Sorry that it's a little religious, it's for a project due t
How does Louis Sachar use subplots to make Holes  interesting
What's a simple sentence
what are welfare payments or subsidies
Why is the time and place important to the plot of the story