daily pastebin goal
44%
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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top