Jump to content

Counting vol. 2


rMks

Recommended Posts

from functools import reduce


current_list = [5, 15, 20, 30, 50, 55, 75, 60, 70, 80, 90, 100]
count_number = reduce((lambda x, y: x + y if int(sum(current_list)) > 5039 else 5039), current_list)
print(count_number) # 5039
  • Haha 2
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.