Quick actions

cmd+k|ctrl+k

Navigation

Languages

4.5

Snippet info

Language

Python

Visibility

public

Author

theanhvo221

Created

2016-10-09T16:20:32Z

Updated

2016-10-09T16:28:16Z

lst = list(range(-10,0)) + list(range(1,11))
print(lst)
def my_sum(lst):
    tong = 0
    for number in lst:
        tong = tong + number #tong moi = tong cu + number
    return tong
lst2 = [10, -1, 8, -22,10]
print(my_sum(lst2))
#bai 4.5 b 
def my_product(lst):
    tich = 1
    for char in lst:
        tich = tich * char
    return tich
print(my_product(lst))
INFO