Question
PYTHON Write a that reads the text file apple.txt (provided) and calculates the difference between open and closed price of apple stock in 2008 and
PYTHON Write a that reads the text file apple.txt (provided) and calculates the difference between open and closed price of apple stock in 2008 and writes the result into another text file (appleout.txt) with the following format: (Month, Year, Open, High , Low, Close and Avg Volume)
HINT - Copy the data into two dimensional list then pass the list to functions to do the calculation., then write the data into the output file.
Requirements:
Must use user defined functions
Must use two dimensional array
Must pass two dimensional list to function
December
2008
91.3
103.6
84.55
85.35
33800900
November
2008
105.93
111.79
79.14
92.67
44957200
October
2008
111.92
116.4
85
107.59
66902300
September
2008
172.4
173.5
100.59
113.66
43697600
August
2008
159.9
180.45
152.91
169.53
23273800
July
2008
164.23
180.91
146.53
158.95
33096200
June
2008
188.6
189.95
164.15
167.44
34281100
May
2008
174.96
192.24
172
188.75
32650300
April
2008
146.3
180
143.61
173.95
38841700
March
2008
124.44
145.74
118
143.5
42313100
February
2008
136.24
136.59
115.44
125.02
46645400
January
2008
199.27
200.26
126.14
135.36
62108100
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started