Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

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"