Advertisement
here2share

# func_with_attributes.py

May 30th, 2015
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. # func_with_attributes.py -- maybe same as the class_references.py
  2.  
  3. def hello_world():
  4.     pass
  5.  
  6. def demo(change):
  7.     change.mylist.append('xyz')
  8.     change.mystring += ' Lengthened'
  9.     change.myint *= 20
  10.  
  11. hello_world.mylist = [1,2,3,'abc']
  12. hello_world.mystring = 'Just A String'
  13. hello_world.myint = 5
  14.  
  15. demo(hello_world)
  16.  
  17. print hello_world.mylist
  18. print hello_world.mystring
  19. print hello_world.myint
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement