Guest User

Untitled

a guest
Nov 19th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. a = [5, 10, 15, 20, 25]
  2. b = [a[0], a[-1]] #list comprehension
  3.  
  4. print(b)
  5.  
  6. def go(x): #function for the same thing, however changes the variable a, easily fixable.
  7. y = x[0], x[-1]
  8. return y
  9.  
  10. print(go(a))
Add Comment
Please, Sign In to add comment