Add chapter 13 Exercise

This commit is contained in:
lolabird 2023-12-13 09:43:40 -07:00
commit 077f45289e

View file

@ -0,0 +1,11 @@
def readposint(num):
try:
val = int(num)
if val > 0:
print("You entered '{}'.".format(val))
else:
print("'{}' is not a positive.".format(val))
except Exception:
print("'{}' is not a number.".format(num))
readposint(input("Please enter a positive number: "))