Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Programming questions