Question: Write a program to convert a list of numbers into its squares For this question, use a for loop first (as one way), and

Write a program to convert a list of numbers into its squares For this question, use a for loop first (as one

Write a program to convert a list of numbers into its squares For this question, use a for loop first (as one way), and list comprehension (as the second) original (1, 2, 3, 4, 5, 6, 7) for loop: [1, 4, 9, 16, 25, 36, 49] list comprehension: [1, 4, 9, 16, 25, 36, 49) Concatenate two lists in the following order 1.3 (5 points) Concatenate two lists in the following order: Use the list comprehension to iterate for this question. list1= ["North", "East "] list2 = ["South", "West"] results ['North South', 'North West', 'East South', 'East West'] 1.4 (10 points) Write a program to iterate both lists simultaneously and display items from list1 in original order and from list2 in reverse order simultaneously. This is similar to ex1.1 except for the second list zip parameter (zip(list1, list2[::-1]) needs to be from the back. list1= [10, 20, 30, 40] list2 = [100, 200, 300, 400] output: 10 400 20 300 30 200 40 100

Step by Step Solution

3.32 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!