Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sum_tuples(tuples_list):
- result_list = []
- for i in tuples_list:
- result_list.append(i[0] + i[1])
- return result_list
- list1 = [(1,2),(3,4),(5,6),(7,8)]
- list2 = [('a','b'), ('a','c'), ('b','c')]
- print(sum_tuples(list1))
- print(sum_tuples(list2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement