Question: Problem 3 (All-in-one: list + string + file read): We downloaded several stock's daily level data for you in /data/hw2_data/stock_data/. You will write code that

Problem 3 (All-in-one: list + string + file read): We downloaded several stock's daily level data for you in /data/hw2_data/stock_data/. You will write code that takes stock tickers as inputs and output one dictinoary. The dictionary uses the stock tickers as keys and the values are these stocks' average open prices in 2017 (until the end of the file). Exmaple: input: tickers = ["AAPL" ] output: {'AAPL' : 143. 465799260355} In [ ]: def problem4(tickers) : file_location = "./data/stock_data/" return_dict = { } return (return_dict) In [ ]: assert problem4( ["AAPL"]) == {'AAPL' : 143.465799260355} In [ ] : assert problem4 ( ["AAPL", "GOOG"]) == {'AAPL' : 143. 465799260355, 'GOOG' : 884. 3826611893493}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
