# A function that asks the user to enter a positive whole number # (positive integer) and returns it (if it is positive, otherwise, # the function makes the user enter another number). # This function returns an integer. def getPositiveInt(): while (True): userInput = input("Enter a positive integer:") try: userInt = int( userInput) if ( userInt > 0 ): return( userInt) else: print("Number is NOT positive! Try again!") except: print("Not an integer! Try again!")