daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest May 16th, 2018 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def create_linear_stock(value=None):
  2.     if not value:
  3.         value = random.randint(1, 100)
  4.  
  5.     stock = dict(locals())
  6.     stock['symbol'] = uuid4()
  7.  
  8.     stock['slope'] = random.uniform(-1, 1)
  9.  
  10.  
  11. #    def tick(self): #  I was trying this
  12.     def tick():
  13.         stock['value'] += stock['slope']
  14.  
  15.     stock['tick'] = tick
  16.    
  17.     return stock
RAW Paste Data
Top