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, 22.06.2019 06:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
question
Computers and Technology, 22.06.2019 11:00
What are two of the most common reasons that peolpe who need mental health care do not access it?
Answers: 1
question
Computers and Technology, 22.06.2019 16:30
Which of the following statements best describes it careers?
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
In my email i got a message it says a quick message and in message details on who its from its says nicole and under nicole is [email protected] -
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
question
Chemistry, 12.11.2020 19:50
question
Chemistry, 12.11.2020 19:50
question
Mathematics, 12.11.2020 19:50
question
Mathematics, 12.11.2020 19:50
question
Law, 12.11.2020 19:50
Questions on the website: 13722361