id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

double_list


Write a function named double_list that takes a list of strings as a parameter and that replaces every string with two of that string. For example, if the list stores the values ["how", "are", "you?"] before the function is called, it should store the values ["how", "how", "are", "are", "you?", "you?"] after the function finishes executing.


double_list(['how', 'are', 'you']) → ['how', 'how', 'are', 'are', 'you', 'you']
double_list(['I', 'am', 'great', 'thanks']) → ['I', 'I', 'am', 'am', 'great', 'great', 'thanks', 'thanks']
double_list(['OneStringOnly']) → ['OneStringOnly', 'OneStringOnly']

...Save, Compile, Run (ctrl-enter)

def double_list(lst):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 100 Post-solution available

Copyright Nick Parlante 2017 - privacy