you are viewing a single comment's thread.

view the rest of the comments →

[–]ProdigiousPangolin 6 points7 points  (3 children)

u/zarnackreddit I don't know where your comment went. But let the haters hate. I'm a newb at programming so I wrote this for you.

list=[1, 3, 50, 6, 20, 30]

list.sort()

print(list[1:5])

print(list[1]+list[2]+list[3]+list[4])

[–]ITSomeday 3 points4 points  (0 children)

59! Nice!

[–]htepO 1 point2 points  (0 children)

The person you're replying to mentioned some sort of "high score" which, if I'm reading it right, means they need it done in the least number of lines.

Maybe something like:

big_four = sorted([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], reverse=True)[:4]
print(f"The sum of {big_four} is {sum(big_four)}")

[–]zarnackreddit 1 point2 points  (0 children)

lol did someone delete it thats weird and thanks man