Given a list of Objects, find the minimum and maximum value on the basis of an object property in Python.

For Example, from a list of cars and find out which car has will come first and last in terms of their max speed.

To do this, we have to

  1. Declare a class named car with max_speed as one of its properties.
  2. Create list of car’s objects.
  3. Find the minimum and maximum of the objects on the basis of max_speed.

Recommended:

output

If you have any doubts or suggestion then please comment below.

Leave a Reply