I have a program that simulates a bus in the form of a list and there is an ability to add passengers to the bus. I want to be able to set a max number of passengers, so that if the list exceeds 25 passengers I display a code stating that the bus is full.
Is it possible to set this limit in a list with Python.
Here is a snippet of the code:
#defining a class for the passenger list
class Bus:
passengers = []
number_of_passengers = 0