Question: hi this code right here prints this Stock Symbol: IBM Should Buy: True Current Price: 1 4 3 . 0 High Price: 1 4 5

hi this code right here prints this Stock Symbol: IBM
Should Buy: True
Current Price: 143.0
High Price: 145.0
Low Price: 139.5
{'stocksymbol': 'IBM', 'shouldbuy': True, 'price': 143.0,'high': 145.0,'low': 139.5} can you code that flask part and have it print out that in a html flask app as simple as possible and explan here is my code import requests plz do not use chat gpt for the htmp template code it in python
def get_stock_info(stocksymbol):
apikKey ="I2FIH3DMPX4A1GDM"
url =f"https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol={stocksymbol}&apikey={apikKey}"
httpresponse =requests.get(url)
json =httpresponse.json()
stocksymbol =json['Global Quote']['01.symbol']
price =json['Global Quote']['05.price']
previous_close =json['Global Quote']['08.previous close']
high =json['Global Quote']['03.high']
low =json['Global Quote']['04.low']
shouldbuy =price >previous_close
info_dictionary ={
"stocksymbol": stocksymbol,
"shouldbuy": shouldbuy,
"price": price,
"high": high, "low": low,
"previous_close": previous_close
}
return info_dictionary

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!