#! /usr/bin/env/ python import sys # --------------------- # Function: def fancy(number): """ INPUT: a number between 0 and 100 OUTPUT: a string with the number printed out that number of times EXAMPLE: number = 7, result = '7777777' """ result = "" ##### ## 1. YOUR CODE GOES HERE! ##### return result # ----------------- # Main body of code ##### ## 2. FIX THE CODE HERE: loop over the input until the number is less ## than 100 ... while True: # Ask user to enter a number print "Please enter a number (less than 100) and hit return!" sys.stdout.flush() raw_number = raw_input() # Convert raw_number into an integer, if possible: try: number = int(raw_number) except: sys.stderr.write("Please enter a valid number!\n") sys.exit(1) print "Thank you!" fancified = fancy(number) print fancified # ... #####