Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. >>> def replace_contents(g):
  2.      g[0] = 17
  3.      g[1] = 28
  4.      g[2] = 45
  5.     print("g =", g)
  6.  
  7. >>> f
  8. [14, 23, 37]
  9. >>> replace_contents(f)
  10. g = [17, 28, 45]
  11. >>> f
  12. [17, 28, 45]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement