Example:
How many elements? 2
List 1 = ['a', 'b']
List 2 = ['c', 'd']
Output:
ac
ad
bc
bd
n = int(input("How many elements? ")) print("Enter values for list1") list1 = [] for i in range(n): list1.append(input("Enter value: ")) print("Enter values for list2") list2 = [] for i in range(n): list2.append(input("Enter value: ")) print("List 1 =",list1) print("List 2 =",list1) for x in list1: for y in list2: print(x+y)
Get Answers For Free
Most questions answered within 1 hours.