How can I read the minimum value of "price" parameter in the "room_options" list, with n elements of the list. Each list item is an instance of Room class:
开发者_如何学Pythonroom_options: (list)
[0] Room
[1] Room
[2] Room
[3] Room
...
[n] Room
Room:
price=700
currency="PLN"
type="Twin Room"
dining=True
I'd like to read a minimum value with the statement:
min(unknown_statement)
min(room_options, key=lambda x: x.price)
min(room.price for room in rooms)
EDIT: see comment
精彩评论