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
nikitadnepr [17]
3 years ago
13

Write a method doubleUp that doubles the size of a list of integers by doubling-up each element in the list. Assume there's enou

gh space in the array to double the size. Suppose a list stores the values [1, 3, 2, 7]. After calling list.doubleUp(), the list should store the values [1, 1, 3, 3, 2, 2, 7, 7].
Computers and Technology
1 answer:
madreJ [45]3 years ago
6 0

Answer:

def double_up(self, mylist):

   doubled = list()

   for item in mylist:

       for i in range(2):

           doubled.append(item)

   return doubled

Explanation:

The program method double_up gets the list argument, iterates over the list and double of each item is appended to a new list called doubled.

Methods are functions defined in classes. A class is a blueprint of a data structure. Each instance of the same class holds the same attributes and features.

You might be interested in
What do GUI use except​
gregori [183]

Answer:

Lol this is your first question.

Explanation:

This is so easy how is this even a question

4 0
3 years ago
Is doing free lancing from age 16 good or bad?​
Art [367]

Answer:

I think it's good. It will serve as an experience for you. Having experience at an early age is better as you could be at your best before you go into the field that you want. Plus free lancing wouldnt tie you down, gives you more freedom. And extra income(?). ^^

8 0
2 years ago
Help meeeeeeeeeeeeeee please​
bija089 [108]

Answer:

Explanation:My explanation is above my comment :)

3 0
3 years ago
What is the difference between file and directory​
Olin [163]

The basic difference between the two is that files store data, while folders store files and other folders. The folders, often referred to as directories, are used to organize files on your computer

8 0
3 years ago
Describe the purpose of shell scripts. Provide one example to reflect the use of variables, constructs, or functions.
Sindrei [870]

Answer:

Kindly check explanation

Explanation:

Shell scripts are used for writing codes which may involve writing together a complete set of task in a single script. These set if codes or instructions could be run at once without having to run this program one after the other on a command line. This way it avoid having to repeat a particular task each time such task is required. As it already combines a sequence of command which would or should have been typed one after the other into a compiled single script which could be run at once.

A shell script could be written for a control flow construct :

if [expression]

then (command 1)

else (command 2)

.....

7 0
3 years ago
Other questions:
  • The _____ element of the wsdl describes the data being exchanged between the web service providers and the consumers, including
    12·1 answer
  • Which category of software would programming languages fall into?
    8·2 answers
  • PLS ANSWER QUICK!!!!
    12·1 answer
  • Which scenario is best for an online discussion group?
    5·1 answer
  • Which feature of a website takes you to a different part of the website or a totally different website when you click on it? A.
    8·1 answer
  • Choose the words that make the following sentence true.<br> Primary memory is
    5·1 answer
  • No down payment, 18 percent / year, payment of $50/month, payment goes first to interest, balance to principal. Write a program
    9·1 answer
  • Will mark Brainliest!! What is the best hard disk compacity? Why?
    7·1 answer
  • Ivan wants to have code in a game that will make it possible to change the speed of a swimmer in the game. Which of these does I
    10·1 answer
  • What is bit in computer science? (You must select all correct answers.) Hb. A. A part of a tool, such as a router. Non. B. A bas
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!