insidesherpa / JPMC-tech-task-1

56 stars 350 forks source link

Float object not suceptible #197

Open 6anshuman23 opened 4 years ago

6anshuman23 commented 4 years ago

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())

    """ ----------- 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']))
lepakshiagarwal commented 4 years ago

It is prices['ABC'] in the last line instead of price['ABC']