######### # Assignment #K ########### # functions def scat(kitty): return kitty **2 def circum(pup): return 3.1417 * 2 * pup def circarea(pup): return 3.1417*scat(pup) def recarea(a,b): return a * b #### main ##### # squaring stuff a = input("Gimme a number ") b = input("Gimme another number ") # print "Youse first numba squared is ", scat(a) # print "The sum of the numbers squared is ", scat(a+b) # print "The square of the second number squared is ",scat(scat(b)) # print "The circumference of a circle with radius ",b, " is ", circum(b) # print "The area of a circle with radius ",b," is ", circarea(b) # rectarea = a * b # print "The area of a rectangle with sides of ", a, " and ",b, " is ", rectarea # print "The area of a rectangle with sides of ", a, " and ",b, " is ", recarea(a,b) quit = 1 while quit == 1: print "Please choose the number corresponding to your choice : " print " 1 - Calculate area of circle with radius of b" print " 2 - Calculate circumference of circle with radius b" print " 3 - Calculate area of rectangle with sides a and b " print " 4 - Calculate area of square with sides of a" print " 5 - End " choice = input("Enter your choice: ") if choice == 1: print "The area of a circle with radius ",b," is ", circarea(b) elif choice == 2: print "The circumference of a circle with radius ",b, " is ", circum(b) elif choice == 3: print "The area of a rectangle with sides of ", a, " and ",b, " is ", recarea(a,b) elif choice == 4: print "The area of a square with sides of ",a," is ", scat(a) elif choice == 5: quit = 0 else: print "That was not a valid choice" print print "Thank you"