i have to write a code that tells the user to enter the amount of minutes they were allowed to use, it has to be between 200 and 800
if it exceeds or goes below then it should print
"please enter minutes between 200 and 800"
the problem is:
if the user enters a number less or above i dont know how to loop it to ask the question again. this is what i have so far
p.s. this would be the same problem with my def used(): as well,
def main():
minutes=mins()
use=used()
calctotal (use, minutes)
def mins():
mins = input("how many minutes are allowed")
if mins <200:
print "Please enter minutes between 200 and 800"
if mins >800:
print "Please enter minutes between 200 and 800"
return mins
def used():
used = input("how many minutes were used")
if used < 0:
print "enter minutes used of at least 0"
return used
def calctotal(use,minutes):
if use > minutes:
Over = (use - minutes)
print "you were over: ", Over
if use < minutes:
Over = 0
print "you were not over your minutes for the month"
Total = 74.99 + (Over * .2)
print "-----------------MONTHLY USE REPORT----------------"
print "Minutes allowed were" , minutes
print "Minutes used were" , use
print "Minutes over were" , Over
print "Total due is $" , Total
main()