i am a student taking a python course, and for one of my assignments i have come up with this:
i can't get the end part to work right, though.Code:## assignmentOne.py ## requests input from the user and then prints out the result for a math equation. def main(): print "This program requests two inputs from the user, adds the values," print "and prints the result." print x = float(input("Please enter the first value: ")) y = float(input("Please enter the second value: ")) print print "The value of", x, "+", y, "is", x+y print if input("Type 'restart' to start over or 'done' to quit: ") == "restart": main() else: end() def end(): print "Good Bye!" main()
the whole rest of the program works, but when i tell the program to restart, it doesn't.
please help
Edit:
nevermind, i figured out the problem.
at the end i needed a raw_input, not a regular input.


LinkBack URL
About LinkBacks

Reply With Quote
