Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def append_mutable(my_list=list()):
- my_list.append(len(my_list))
- return my_list
- def append_none(my_list=None):
- if my_list is None:
- my_list = list()
- my_list.append(len(my_list))
- return my_list
- if __name__ == '__main__':
- for _ in range(4):
- print(append_mutable())
- for _ in range(4):
- print(append_none())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement