Advertisement
Rementai

Suma krotek

Mar 9th, 2023 (edited)
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. def sum_tuples(tuples_list):
  2.     result_list = []
  3.     for i in tuples_list:
  4.         result_list.append(i[0] + i[1])
  5.     return result_list
  6.  
  7. list1 = [(1,2),(3,4),(5,6),(7,8)]
  8. list2 = [('a','b'), ('a','c'), ('b','c')]
  9.  
  10. print(sum_tuples(list1))
  11. print(sum_tuples(list2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement