#--------- # Filename: myProgram.py # Author: Student Name # Lecture/Lab section: 00x/2xx # Assignment: Lab #x # Date: xx/xx/xx # Discrepancies: # In this section put any parts of the ssignment that you # were unable to get working. # Explain how it should work, and what the algorithm is. If you have # a reasonable algorithm, but just could not code it, we will give # some partial credit. #--------- #--------- # imported modules/libraries #--------- import math #--------- # function definitions #--------- def print_menu(): print "Select an option below:" print " 1 - Calculate sqrt + 1" print " 2 - Exit" print def calc_sqrt_plus_one(): print math.sqrt(input("Enter #: ")) + 1 #y = input("Enter #: ") #y = math.sqrt(y) + 1 #print y #--------- # main #--------- def main(): print_menu() for i in range(999): x = input("Enter option: ") if x == 1: calc_sqrt_plus_one() elif x == 2: print "Bye, Bye..."; break else: print "Incorrect option, try again..." main()