1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
pochemuha
3 years ago
12

Write a function named reverse_list that takes as a parameter a list and and reverses the order of the elements in that list. It

should not return anything - it should mutate the original list. This can be done trivially using slices, but your function must not use any slicing.
Computers and Technology
1 answer:
WITCHER [35]3 years ago
5 0

Answer:

The function in python is as follows:

def reverse_list(nums):

   half =int(len(nums)/2)

   for i in range(half):

       nums[i], nums[len(nums)-i-1] = nums[len(nums)-i-1],nums[i]

   print(nums)

Explanation:

This defines the function

def reverse_list(nums):

This gets the half the length of the list

   half =int(len(nums)/2)

This iterates through the list

   for i in range(half):

This swaps list items with the opposite item on the other half

       nums[i], nums[len(nums)-i-1] = nums[len(nums)-i-1],nums[i]

This prints the new list

   print(nums)

You might be interested in
What should you rely on to determine when to change your oil? a. Oil color b. 6,000 miles since the last oil change c. Owners ma
jeka57 [31]

Best answer is: Owners manual based on driving habits


Explanation:

If you are one of the many people who let a windshield reminder sticker govern when they get an oil change, here's our advice to you: Drop that habit. Instead, follow the automaker's recommended service intervals. In many modern cars, your best bet is to rely on the vehicle's oil life monitoring system to let you know when it's time for a change.

3 0
3 years ago
______ is a disadvantage of EDI.
Artist 52 [7]

Answer:The number of standards

Explanation:Electronic data interchange (EDI)  is the mechanism through which data is interchanged in the system electronically.It is mostly found in the business field for exchanging of data.

As EDI helps in making message accurate by decreasing the length and also has beneficial features of maintaining the security and increasing productivity ,hence these factor are not considered as the disadvantage .

Too many standard present in the EDI make the working complex by limiting the processing in the small business as compared with large organization.

 

6 0
3 years ago
Question #4
Nataliya [291]
A is your answer.............
3 0
3 years ago
Sorry but, what are brainliest for?
Advocard [28]

Answer:

smartest and accurate answer

Explanation:

5 0
4 years ago
Read 2 more answers
To add slides to a presentation, _____.
Effectus [21]
<span>select the New Slide option from the Insert menu</span>
7 0
3 years ago
Other questions:
  • Anderson uses his computer and internet link to chart the movement of his favorite 46 stocks. He buys and sells according to the
    15·1 answer
  • Mateo could not find the undo command or shortcut. He should _____.
    15·2 answers
  • List some good names for devices on your home network or on the network in your school's lab. Demonstrate the use of best practi
    13·1 answer
  • Who are the four main antagonists in fnaf 1
    13·2 answers
  • Drawing programs typically create images using mathematical formulas, instead of by coloring pixels, so images can be resized an
    12·1 answer
  • What is "mob of the dead"?
    7·1 answer
  • What is the best motivation that you can do/give to make your employees stay? ​
    6·1 answer
  • How are actual rocket launches similar to how balloon rockets and canister rockets launch?
    6·1 answer
  • Which of the following statements best explains how multitasking works in the human mind?
    11·1 answer
  • Task 2
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!