#A POORLY DOCUMENTED PROGRAM #A function to get a number between 1 and 100 #input: none #output: int between 1 and 100 def getNumInRange(): x = input("Please enter a number: ") while x < 1 or x > 100: if x > 100: x = input("Too high. Enter another: ") else: x = input("Too low. Enter another: ") return x def printResult(userinput, isDivByFive): print "The number entered is: ", userinput if isDivByFive == True: print "The number is divisible by 5." else: print "The number is not divisible by 5." def divisibleByFive(userinput): if userinput%5 == 0: return True else: return False def calcAndPrint(userinput): a = divisibleByFive(userinput) printResult(userinput, a) #main program logic #get a number from user #pass number to calcAndPrint userinput = getNumInRange() calcAndPrint(userinput)