0
I have a question if i have a 12 list of number how do i sum only 5 highest number
Phython
5 Respostas
+ 1
You don't need y input. Remove it.
You have now sorted list.
Know about list slicing.. and reverse sort,
apply sum as sum(list)
hope you can do it easily..
0
Do you have some code where you have tried?
0
apply sort on list so list get sorted then use list slicing to extract 5 numbers and apply sum function
0
I did my best but still dont get it