Untitled
unknown
plain_text
7 months ago
766 B
1
Indexable
Never
Write a program to add two lists index-wise. Create a new list that contains the 0th index item from both the lists, then the 1st index item, and so on till the last element. any leftover items will get added at the end of the new list. i/p: list1 = ["M", "na", "i", "Ke"] list2 = ["y", "me", "s", "lly"] o/p: ['My', 'name', 'is', 'Kelly'] 2. Write a program to turn every item of a list into its square. 3. Write a program to concatenate two list: i/p: list1 = ["Hello ", "take "] list2 = ["Dear", "Sir"] o/p: ['Hello Dear', 'Hello Sir', 'take Dear', 'take Sir'] 4. Write a program to remove empty string from the list of String using filter function: i/p: list1 = ["Mike", "", "Emma", "Kelly", "", "Brad"] o/p: ["Mike", "Emma", "Kelly", "Brad"]
Leave a Comment