insidesherpa / JPMC-tech-task-1

56 stars 350 forks source link

Issue in software #198

Open 6anshuman23 opened 4 years ago

6anshuman23 commented 4 years ago

I seriously can't get what the hell is that indentation the code is correct yet what the hell does it require

if name == "main":

# Query the price once every N seconds.
for _ in iter(range(N)):
    quotes = json.loads(urllib.request.urlopen(QUERY.format(random.random())).read())

    """ ----------- Update to get the ratio --------------- """
prices = {}
    for quote in quotes:
        stock, bid_price, ask_price, price = getDataPoint(quote)
  prices[stock] = price
        print ("Quoted %s at (bid:%s, ask:%s, price:%s)" % (stock, bid_price, ask_price, price))

    print ("Ratio %s" % getRatio(prices['ABC'], prices['DEF']))
ghost commented 4 years ago

# Main if __name__ == "__main__": for _ in iter(range(N)): quotes = json.loads(urllib.request.urlopen(QUERY.format(random.random())).read()) prices = {} for quote in quotes: stock, bid_price, ask_price, price = getDataPoint(quote) prices[stock] = price print ("Quoted %s at (bid:%s, ask:%s, price:%s)" % (stock, bid_price, ask_price, price)) print ("Ratio %s" % (getRatio(prices['ABC'], prices['DEF'])))

i hope this will help you

ghost commented 4 years ago

or for indentation error you can check in pdf provide by jpmorgan's site .