hi people,
I'm trying to get a loop going for a project and just can't seem to get it work work. the program works before I put the 'while' statement in but as soon as I do the program does nothing. Ive included the program with the 'while' statement that stalls and also the program without
NOT WORKING PROGRAM
I'm trying to get a loop going for a project and just can't seem to get it work work. the program works before I put the 'while' statement in but as soon as I do the program does nothing. Ive included the program with the 'while' statement that stalls and also the program without
NOT WORKING PROGRAM
#Delcare 3 constants
StardardPolicy = 0.10
ExtraPremium = 0.05
GST = 0.10
#Delcare 2 start values
PolicySold = 0
TotalValue = 0
#Loop
keep_going = 'y'
while keep_going == 'y':
def main ():
Value_Of_Car = int(input( 'What is the Value of your Car? '))
Age_Of_Driver = int(input( 'What is the age of the driver? '))
Pay_By_Month = input( 'Would you like to pay by the month? ')
Cal_Premium (Value_Of_Car, Age_Of_Driver, Pay_By_Month)
def Cal_Premium (num1, num2, num3):
Pay_By_Month = num3
Age_Of_Driver = num2
Value_Of_Car = num1
if Pay_By_Month == 'n':
print('Your Yearly Premium would be $', Value_Of_Car * StardardPolicy)
else:
print('test test test')
main ()
keep_going = input( 'Would you like to keep going? y/n ')WORKING NO LOOP#Delcare 3 constants
StardardPolicy = 0.10
ExtraPremium = 0.05
GST = 0.10
#Delcare 2 start values
PolicySold = 0
TotalValue = 0
#Loop
keep_going = 'y'
def main ():
Value_Of_Car = int(input( 'What is the Value of your Car? '))
Age_Of_Driver = int(input( 'What is the age of the driver? '))
Pay_By_Month = input( 'Would you like to pay by the month? ')
Cal_Premium (Value_Of_Car, Age_Of_Driver, Pay_By_Month)
def Cal_Premium (num1, num2, num3):
Pay_By_Month = num3
Age_Of_Driver = num2
Value_Of_Car = num1
if Pay_By_Month == 'n':
print('Your Yearly Premium would be $', Value_Of_Car * StardardPolicy)
else:
print('test test')
main ()
