Comments (2)
did you define dictionary price ={}
from jpmc-tech-task-1.
first, think you have to define prieces={}
then while iterating Quotes that time add then stocks with their price
prices[stock] = price
this is a Tab error I think
PS D:\professional work\JpMorgan\JPMC-tech-task-1-py3> python client3.py
File "D:\professional work\JpMorgan\JPMC-tech-task-1-py3\client3.py", line 65
for quote in quotes:
terror: inconsistent use of tabs and spaces in indentation
You can you single space instead of Tabs (tabs may be spaces diff but after single spaces not going to be a problem 👍
Solution
`if name == "main":
# Query the price once every N seconds.
for _ in 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'])))
`
from jpmc-tech-task-1.
Related Issues (20)
- Module not found error , No module found urllib2
- Import error
- JPMC-tech-task-1
- Bash not opening in jpm_module_1 HOT 5
- git error
- Indentation error: expected an indented block
- Cannot import izip from itertools
- problems with python client.py
- problem with client.py,server.py
- issue regarding python server.py command line HOT 4
- issue regarding python client.py HOT 1
- server.py and clien.py issue
- Facing issue on server.py and client.py HOT 4
- workaround 2for python identation problem on repl.it HOT 1
- not able to run os.system(bash)
- Missing parentheses in call to 'print'
- cant find patch file in files
- JPMC_Module_1
- bash: cd: jpm_module_1: No such file or directory HOT 2
- Not sure why 'ABC' is wrong
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jpmc-tech-task-1.