Rachel M.

asked • 03/09/23

I need help getting rid of a line of code without messing up the code

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

By:

Ziling Z. answered • 03/11/23

Tutor
New to Wyzant

Computer Scientist

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.