in

sneaky Python

sneaky Python

def append_to(element, to=[]):

to. append (element)

return to

my_list = append_to (12)

print(my_list)

my_other_list = append_to (42)

print(my_other_list)

[12]

[12, 42]

What do you think?

Written by codeitbro

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings