Ziling Z. answered 03/11/23
Computer Scientist
Rachel M.
asked 03/09/23def 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*
Ziling Z. answered 03/11/23
Computer Scientist
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.