Question

Question 16 Write code that prompts the user to enter a positive nonzero number and validates the input:
0 0
Add a comment Improve this question Transcribed image text
Answer #1
n = int(input("Enter a positive nonzero number: "))
while n<=0:
    print("Invalid input.. Please enter again")
    n = int(input("Enter a positive nonzero number: "))
print("Valid number is:",n)

Output :

0 Enter a positive nonzero number: Invalid input.. Please enter again Enter a positive nonzero number: Invalid input.. Please

Note: Please comment below if you have any doubts. upuote the solution if it helped. Thanks!
Add a comment
Answer #2
Help me I am new student and from somalia
source: Student
answered by: anonymous
Add a comment
Answer #3
Write code that prompts the user to enter number in the range of 1 through 100 and validates the input
answered by: Sara hassan
Add a comment
Know the answer?
Add Answer to:
Question 16 Write code that prompts the user to enter a positive nonzero number and validates...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT