I am getting an error with my script. It keeps telling me that my averageWeeklyMiles is not defined but you can clearly see that I have established
I am getting an error with my script. It keeps telling me that my averageWeeklyMiles is not defined but you can clearly see that I have established what it needs to be. My code is below. Can I get any assistance on this?
if rentalCode == ‘W’:
averageWeeklyMiles = float(totalMiles)/float(rentalPeriod)
if averageWeeklyMiles <= 900:
extraMilesCharge = 0
else:
mileCharge = 100 * float(rentalPeriod)
******ERROR******
Traceback (most recent call last):
File “rental_car.py”, line 84, in
if averageWeeklyMiles <= 900:
NameError: name ‘averageWeeklyMiles’ is not defined
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"
