Explore Westonci.ca, the top Q&A platform where your questions are answered by professionals and enthusiasts alike. Get quick and reliable answers to your questions from a dedicated community of professionals on our platform. Our platform offers a seamless experience for finding reliable answers from a network of knowledgeable professionals.

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

Sagot :

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