Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = [5, 10, 15, 20, 25]
- b = [a[0], a[-1]] #list comprehension
- print(b)
- def go(x): #function for the same thing, however changes the variable a, easily fixable.
- y = x[0], x[-1]
- return y
- print(go(a))
Add Comment
Please, Sign In to add comment