Dimo4ka Posted January 10, 2023 Posted January 10, 2023 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 2
Paul Elton Posted January 11, 2023 Posted January 11, 2023 (edited) 1001110110100 Edited January 11, 2023 by Paul007 1
Dimo4ka Posted January 11, 2023 Posted January 11, 2023 7 hours ago, Paul007 said: 1001110110100 # binary number a = '1001110110100' print(int(a, 2)) # 5044 5045 1
Recommended Posts