Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Python 3.5 or newest release Imagine that the most of the functions that we have been using to process lists in Python do not

In Python 3.5 or newest release

Imagine that the most of the functions that we have been using to process lists in Python do not exist. For the problems below you are not allowed to use any list methods (append, remove, insert, etc) or certain core Python functions specified in each problem. You may, however, use your own custom-written functions to solve these problems (i.e. if you find that your listlen() function would be useful in writing another function you are welcome to use it). Given these restrictions, write a series of functions that do the following:

7. Write a new function called "listreverse" based on the following IPO

# function: listreverse # INPUT: a list # PROCESSING: creates a copy of the supplied list that # contains the same elements as the original # list, but in reverse order # OUTPUT: return a new copy of the list in reverse order 

Make sure that you DO NOT use any list methods such as "reverse" your program. Note that your original list should not change when you run this function. Here is a sample running of this program:

mylist = [10, 20, 30] x = listreverse(mylist) print (x) print (mylist) >> [30, 20, 10] >> [10, 20, 30] 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

Find y'. y= |x + X (x) (x) X 1 02x+ 2x 1 O 2x + 1/3 Ex 2x +

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago