Guest User

Untitled

a guest
Feb 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. def greeting(name = 'Guest'):
  2. print(f'Hi {name}!')
  3.  
  4. greeting()
  5. greeting('Kristine')
  6.  
  7. # Nope
  8. def some_function(collection = []):
  9. collection.append(1)
  10. print(id(collection))
  11. return collection
  12.  
  13.  
  14. print(some_function())
  15. print(some_function())
  16. print(some_function([1, 2, 3]))
  17. print(some_function())
  18. print(some_function())
  19.  
  20. print(id(some_function()))
  21. print(id(some_function()))
  22. print(id(some_function()))
  23. print(id(some_function()))
Add Comment
Please, Sign In to add comment