subject

In this unit, you used this code to ensure that the user would enter a number and not letters: while True:

try:

num = int(input("Enter your age: "))

break

except ValueError:

print("That's not a number!")

How could you modify this code to be sure that the user enters a positive number?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Asecurity policy is a a. set of guidlines b. set of transmission protocols c. written document d. set of rules based on standards and guidelines
Answers: 2
question
Computers and Technology, 24.06.2019 02:30
Which option completes the explanation for conflict of interest in an organization
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
Cómo pongo un tomo de llamada sin pagar?
Answers: 1
You know the right answer?
In this unit, you used this code to ensure that the user would enter a number and not letters: whil...
Questions
Questions on the website: 13722361