Created
May 11, 2018 03:01
-
-
Save z3t0/1e3870f88e246276f0e5ae3f417dcd08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_linear_stock(value=None): | |
if not value: | |
value = random.randint(1, 100) | |
stock = dict(locals()) | |
stock['symbol'] = uuid4() | |
stock['slope'] = random.uniform(-1, 1) | |
# def tick(self): # I was trying this | |
def tick(): | |
stock['value'] += stock['slope'] | |
stock['tick'] = tick | |
return stock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment