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 15:30
What is a costume plot? why is it important to a film or theater production?
Answers: 2
question
Computers and Technology, 22.06.2019 17:30
Type the correct answer in the box. spell all words correctly. under which key category do the page up and page down keys fall? page up and page down keys fall under the keys category.
Answers: 3
question
Computers and Technology, 23.06.2019 14:30
The option enables you to modify a slide element in most presentation applications.
Answers: 2
question
Computers and Technology, 24.06.2019 04:30
What is the process in which the software development team compiles information to determine the final product
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
Mathematics, 17.04.2021 01:00
question
Arts, 17.04.2021 01:00