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

The planet Pluto is 39.5 AU’s from the sun.How long does it take to go around the sun once.
Dilation of a line by a scale factor 1/3 centered at the point (4,2)
A bucket is being filled at a rate of 5/6 gallon in 1/4 minute. What is the unit rate in gallons per minute?
What number represents the same amount as 7 7 hundreds + + 0 0 tens + + 1 0 0 100 ones?
If a car is depreciated in four years, what's the rate of depreciation using twice the straight-line rate?
Why did Washington Issue this "Neutrality Proclamation".
For question 4 the last option is “shield laws”
Not sure how to do this
Help meh pls Mrs. Johnson gave a sum of money to her son and daughter in the ratio 5: 6. Her daughter received $2,400. How much did Mrs. Johnson give away in a
Queen Nzinga fought against Portuguese influence in what African country?