Skip to content

Instantly share code, notes, and snippets.

@roman-on
Created April 21, 2020 00:14
Show Gist options
  • Save roman-on/a6042f7a5436b677b707e1008a2bf665 to your computer and use it in GitHub Desktop.
Save roman-on/a6042f7a5436b677b707e1008a2bf665 to your computer and use it in GitHub Desktop.
"""
The function accepts two lists list_y, list_x. The function extends list_x (modifies it) so that at the beginning
it also contains list_y, and returns list_x.
x = [4, 5, 6]
y = [1, 2, 3]
extend_list_x(x, y)
[1, 2, 3, 4, 5, 6]
"""
def extend_list_x(list_x, list_y):
a = list_x
b = list_y
y = [b[0], b[1], b[2], a[0], a[1], a[2]]
return (y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment