xxxxxxxxxx
import functools
numbers = [175, 50, 25]
total = functools.reduce(lambda total, rightValue: total + rightValue, numbers)
print(total)
xxxxxxxxxx
"""If the numbers inside a list are all integers,
floats, or a combination of both, you can use the sum() function.
"""
number_list=[1, 2, 3, 4, 5, 7, 8, 5.5, 7.987, 7845.12454, 100, 200, 300]
print(sum(number_list))
# Now that I have helped you, don't you want to like this post?
xxxxxxxxxx
# to sum all the numbers we use python's sum() function
a = [4,5,89,5,33,2244,56]
a_total = sum(a)
xxxxxxxxxx
a_list = [1, 2, 3]
integers_to_append = 4.
a_list. append(integers_to_append)
print(a_list)
xxxxxxxxxx
lst = []
num = int(input('How many numbers: '))
for n in range(num):
numbers = int(input('Enter number '))
lst.append(numbers)
print("Sum of elements in given list is :", sum(lst))
xxxxxxxxxx
list[]
counter=1
while(counter<=20)
aa=input("enter aminoacid:")
list.append(seq)
counter=counter+1