[Tutor] Help needed

Aaron Brown brownam at gmail.com
Fri Apr 8 03:57:53 CEST 2011


I am in an online python class and am failing badly.  I am not sure where
the problem is here but any insight would be great.

def main():
    while (True):
        allowed = int(input("Please enter minutes allowed between 100 and
700: "))
        used = int(input("How many minutes were used: "))
        totalOver = used - allowed
        totalDue = (64.95 + (0.15*totalOver))
        if(totalOver > 0):
            print("You were over your minutes by " + str(totalOver))
        else:
            totalOver = 0
            print("You were not over your minutes for the month")
            print ("Do you want to end program? Enter yes or no:")
            toEnd = raw_input()
            if toEnd == "yes":
                print("MONTHLY USE REPORT")
                print("Minutes allowed were " + str(allowed))
                print("Minutes used were " + str(used))
                print("Minutes over were " + str(totalOver))
                print("Total due is $ " + str(totalDue(totalOver))

I keep getting a syntax error in a blank line at the bottom.  I have tried
to end it with main() but it errors on the main as well?

Help Please,

Aaron Brown
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110407/a310d4fc/attachment.html>


More information about the Tutor mailing list