Computer Science
Write a program that inputs two lists and creates a third, that contains all elements of the first followed by all elements of the second.
Python
Python List Manipulation
62 Likes
Answer
l1 = eval(input("Enter first list: "))
l2 = eval(input("Enter second list: "))
l3 = l1 + l2
print("Joined List:", l3)
Output
Enter first list: [1, 2, 3, 4, 5]
Enter second list: [11, 12, 13, 14, 15]
Joined List: [1, 2, 3, 4, 5, 11, 12, 13, 14, 15]
Answered By
25 Likes
Related Questions
Write a program to increment the elements of a list with a number.
Write a program that reverses a list of integers (in place).
Ask the user to enter a list containing numbers between 1 and 12. Then replace all of the entries in the list that are greater than 10 with 10.
Ask the user to enter a list of strings. Create a new list that consists of those strings with their first characters removed.