Program - Calculate the sum of every pair of numbers from two lists


Topic: Program - Calculate the sum of every pair of numbers from two lists

Solution

list1 = [1, 2, 3]
list2 = [5, 6, 7] 
final = [a+b for a in list1 for b in list2]
print(f"sum of every pair of numbers from two lists:{final}")



List all Python Programs