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

 

bryce.hulett@hotmail.com > mirror
prev  |  next  |  chance

Write a function named mirror that accepts a list of strings as a parameter and appends the list's contents to itself in reverse order. For example, if a list named letters stores ["a", "b", "c"], the call of mirror(letters) should change it to store ["a", "b", "c", "c", "b", "a"]. Constraints: You may declare a single list as auxiliary storage.


mirror(['a', 'b', 'c']) → ['a', 'b', 'c', 'c', 'b', 'a']
mirror(['hello', 'how', 'r', 'you?']) → ['hello', 'how', 'r', 'you?', 'you?', 'r', 'how', 'hello']
mirror(['flabby']) → ['flabby', 'flabby']

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

def mirror(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: 290 Post-solution available

Copyright Nick Parlante 2017 - privacy