# Electric car problem # Function to calculate cost of charging a car def CarCharge(Minutes): #Constants BaseCost = 1 CostPerMinute = 0.2 MinimumMinutes = 15 PointsPerMinute = 1.5 #Minimum charge is 15 minutes if Minutes < MinimumMinutes: Minutes = MinimumMinutes return BaseCost + (CostPerMinute * Minutes), int(PointsPerMinute * Minutes) # Main program Minutes = 20 Cost, Points = CarCharge(Minutes) print("The cost of {} minutes is £{:.2f}. {} points earned.".format(Minutes, Cost, Points))