Rachel M.
asked 03/09/23I need help getting rid of a line of code without messing up the code*Look at comments ran out of characters*
def run_sim(stops, boarding_rate, exiting_rate, passengers):
stop_count = 1
while stop_count <= stops:
if stop_count == stops:
boarding = 0
departing = passengers
else:
boarding = boarding_rate
departing = min(passengers, exiting_rate)
print(f"{stop_count:^10d}{passengers:^10d}{boarding:^10d}{departing:^10d}")
stop_count += 1
if stop_count <= stops:
passengers = calc_boarded(boarding, departing, passengers)
print(f"Final Stop: {passengers} on the bus") *Need to get rid of this one*
1 Expert Answer
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Rachel M.
Her is the calc_boarded fucntion def calc_boarded(boarding, departing, current): return current + boarding - min(departing, current) print(calc_boarded(15, 25, 10))03/09/23