Suppose, we are given a class called Car that has the following 3 attributes named model (string), year (int) and price (float). The function named find_car() takes three input parameters as follows: an object my_car of Car class, a float my_price, and an int age. This function returns True if my_car's price is at least the given price and my_car is not more than age years old. Otherwise it returns False. Choose the best option to fill the gap on Line# 2. Question options: (my_car.my_price <= price) and (2021 - my_car.age) <= year (my_car.price <= my_price) or (2021 - my_car.year) <= age (my_price == price) and (2021 - age) <= year (my_car.my_price >= price) or (2021 - my_car.age) <= year (my_car.price >= my_price) and (2021 - my_car.year) <= age
Suppose, we are given a class called Car that has the following 3 attributes named model (string), year (int) and price (float).
The function named find_car() takes three input parameters as follows: an object my_car of Car class, a float my_price, and an int age. This function returns True if my_car's price is at least the given price and my_car is not more than age years old. Otherwise it returns False.
Choose the best option to fill the gap on Line# 2.
Question options:
|
(my_car.my_price <= price) and (2021 - my_car.age) <= year |
|
(my_car.price <= my_price) or (2021 - my_car.year) <= age |
|
(my_price == price) and (2021 - age) <= year |
|
(my_car.my_price >= price) or (2021 - my_car.age) <= year |
|
(my_car.price >= my_price) and (2021 - my_car.year) <= age |
Trending now
This is a popular solution!
Step by step
Solved in 2 steps