write a code to get two arrays from user of size 15. Each then generate a third array which contain the elements of array 1 and array 2 .Also make sure that data members of third array are sorted
Answers
Answered by
1
while True:
li = []
for _ in range(2):
li.append(list(map(int, input("Enter 15 nums: ").split())))
li_1, li_2 = li
if len(li_1 + li_2) != 30:
print("\nEnter exactly 15 items.")
continue
else:
li_3 = li_1 + li_2
li_3.sort()
print(li_3)
break
Similar questions