Advertisement
here2share

# class_references.py -- no selfies! (inside humor)

May 29th, 2015
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. # class_references.py -- no selfies! (inside humor)
  2.  
  3. class myClass():
  4.     sales_total = 2548.65
  5.     clothes = ['shirt','hat','pants','shoes','coat']
  6. #
  7.  
  8. def sale(update,item,price):
  9.     update.sales_total += price
  10.     try:
  11.         update.clothes.remove(item)
  12.     except: pass
  13.  
  14. sale(myClass,'hat',128.80)
  15. print myClass.sales_total
  16. print myClass.clothes
  17.  
  18. print dir(myClass)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement