Question: Write Python code that prompts for and inputs (and evaluates) a list of at least five numbers. (You neednt verify that what is entered is
Write Python code that prompts for and inputs (and evaluates) a list of at least five
numbers. (You neednt verify that what is entered is indeed a list of at least five numbers; just
assume it is.) It then prints out the first half and then the second half of the list. (If the list has odd
length, make the second half have one more number than the first.). Next, if the first element is
bigger than the last, swap them. Otherwise, if the first is smaller than the last, increment both by
1. Otherwise (the first element is neither bigger nor smaller than the last, i.e., theyre equal), set
both to 0. Finally, output the altered list. The following is an example execution where the first
element is bigger than the last and the length of the list is odd.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
