Open 6anshuman23 opened 4 years ago
Float object not suceptible even i changed to prices
prices
for _ in iter(range(N)): quotes = json.loads(urllib.request.urlopen(QUERY.format(random.random())).read())
""" ----------- Update to get the ratio --------------- """ for quote in quotes: stock, bid_price, ask_price, price = getDataPoint(quote) print ("Quoted %s at (bid:%s, ask:%s, price:%s)" % (stock, bid_price, ask_price, price)) print ("Ratio %s" % getRatio(price['ABC'], price['DEF']))
It is prices['ABC'] in the last line instead of price['ABC']
Float object not suceptible even i changed to
prices
for _ in iter(range(N)): quotes = json.loads(urllib.request.urlopen(QUERY.format(random.random())).read())