Reference no: EM131963131
Python programming
Ask the user to input two lists. list which interleaves the two lists by taking 1 from the first list and then 1 from the second list. Output the interleaved list. If the either list is longer than the other append the remaining elements from it at the end.
Sample output1:
Please enter list 1: 1 5 10 20
Please enter list 2: 3 9 11 22
The combined list is 1 3 5 9 10 11 20 22
Sample output2:
Please enter list 1: 1 22 2 1 7
Please enter list 2: 11 33
The combined list is 1 11 22 33 2 1 7
Sample output3:
Please enter list 1: 1 2 4 8
Please enter list 2: 13 3 5 9 10 11
The combined list is 1 13 2 3 4 5 8 9 10 11
inp = input("Please enter list 1: ")
inp2 = input("Please enter list 2: ")
ls1 = [int(x) for x in inp.split()]
ls2 = [int(x) for x in inp2.split()]
ans = []
for i in range(len(ls1)):
ans.append(ls1[-1-i])
ans.append(ls2[i])
print("The combined list is", end = " ")
for i in ans:
print(i,end = ' ')
What should I change?
Prepare a summary report of the scholarly activity
: Prepare a summary report of the scholarly activity, including who, what, where, when and any relevant take-home points.
|
Write review on the given article
: Write 500-600 words review on the following article: Article: Employee reactions to talent pool membership (Author(s): Stephen Swailes and Michelle Blackburn)
|
Investment worth-amount of the special payment
: Zach has an investment worth 63,726 dollars. What is X, the amount of the special payment that will be made to Zach in 4 quarters?
|
Describe what happened for the organisations stakeholders
: Describe briefly what happened, the context, and the consequences for the organisation's stakeholders.
|
Append the remaining elements from it at the end
: Output the interleaved list. If the either list is longer than the other append the remaining elements from it at the end.
|
What is the value of investment
: What is the value of an investment that will pay investors 2,270 dollars per year for 7 years
|
What is the payment expected to be in one month
: The interest rate on the loan is 1.15 percent per month. What is the payment expected to be in 1 month?
|
Reflect on the personal knowledge and skills gained
: In your journal, you will reflect on the personal knowledge and skills gained throughout this course. Solid academic writing is expected, and in-text citations.
|
Questions should be asked regarding the computer system
: What can be done to restore these deleted files and what questions should be asked regarding the computer system?
|