Question: Create a class Path which has the following attributes: length width people - list of Person objects It should also have the following methods: add

Create a class Path which has the following attributes:
length
width
people - list of Person objects
It should also have the following methods:
add_person which adds a Person (object) to this pathway if it has capacity.
The capacity of a path in number of people is the length * width /2. If there is no
capacity, the person is not added and return False. If there is capacity, add the
person and return True.
get_traffic which returns the proportion of capacity in the path currently
being used, (representing how busy the path is). This is the number of people
divided by capacity of the path.
 Create a class Path which has the following attributes: length width

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!