Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def greeting(name = 'Guest'):
- print(f'Hi {name}!')
- greeting()
- greeting('Kristine')
- # Nope
- def some_function(collection = []):
- collection.append(1)
- print(id(collection))
- return collection
- print(some_function())
- print(some_function())
- print(some_function([1, 2, 3]))
- print(some_function())
- print(some_function())
- print(id(some_function()))
- print(id(some_function()))
- print(id(some_function()))
- print(id(some_function()))
Add Comment
Please, Sign In to add comment