Skip to content

Commit

Permalink
Create 9.5.6 Enter a Positive Number
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeHS-Solutions authored Jan 20, 2024
1 parent f7bec13 commit 644c07b
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def retrieve_positive_number():
x = int(input("Enter a positive number: "))
if(x >= 0):
return x

while True:
try:
print(retrieve_positive_number())
break
except ValueError:
print("That isn't an integer")

0 comments on commit 644c07b

Please sign in to comment.