QuestionHello! So I am trying to create a program in Python that manages data about stocks in a seperate file which the program reads, and stores using various variables to store the info. Each item is split by a “|” which I tried to incorporate in my code, but I am quite lost. Attached is the code which may explain my situation better, as well as a few stock information for a few example of stocks. Any help would be greatly appreciated 🙂 Name | Symbol | Market Value (millions) |2021-01-04|2021-01-05 |2021-01-06 |2021-01-07 |2021-01-08|2021-01-11|2021-01-12 |2021-01-13 |2021-01-14|2 Exxon Mobil Corporation | XOM | 384845 . 80 | 41.50 |43. 50 | 44. 61 | 44. 96 | 45. 46 | 46. 84 | 47 . 88 | 48. 42 |50. 31 | 47. 89 | 48. 84 | 49. 53 | 48. 11 | 47. 43 | 46. 90 | 45.87 | 45 General Electric Company | GE | 346042. 10 | 83. 76 | 86. 16 | 90. 88 | 90. 16 | 90. 72 |91. 60 |94.24 |92. 56 | 93. 28 | 90. 64 | 91. 44 | 91. 12 | 88. 56 | 88. 88 |87. 92 |90.32 |91 Microsoft Corporation | MSFT | 299647 . 60 |217. 69 |217. 90 |212. 25 | 218. 29 |219. 62 |217. 49 |214. 93 |216. 3… Show more… Show more”””Stock class for stock objects”””class Stock: “”” Constructor to initialize the stock object 1. A string sname for the stock name. 2. A string symbol for the stock symbol.3. A float val for market value.4. A list prices for a list that contains the close market price for one month. “”” def __init__(self,stockInfo): attributes = stockInfo.split(“|”) # attributes split by a list self.initialize(attributes[0],attributes[1],attributes[2],attributes[3], attributes[4]) def initialize(self, sname, symbol, val, prices, lastPrice): self.sname = sname self.symbol = symbol self.val = val self.prices = prices self.lastPrice = lastPrice “”” return the stock information as a string, including name, symbol, market value, and the price on the last day (2021-02-01). For example, the string of the first stock should be returned as: “name: Exxon Mobil Corporation; symbol: XOM; val: 384845.80; price:44.84”. “”” def __str__(self): pass”””Sample stocks from file: on python this is all on one line.Name|Symbol|Market Value (millions)|2021-01-04|2021-01-05|2021-01-06|2021-01-07|2021-01-08|2021-01-11|2021-01-12|2021-01-13|2021-01-14|2021-01-15|2021-01-19|2021-01-20|2021-01-21|2021-01-22|2021-01-25|2021-01-26|2021-01-27|2021-01-28|2021-01-29Exxon Mobil Corporation|XOM|384845.80|41.50|43.50|44.61|44.96|45.46|46.84|47.88|48.42|50.31|47.89|48.84|49.53|48.11|47.43|46.90|45.87|45.35|46.06|44.84General Electric Company|GE|346042.10|83.76|86.16|90.88|90.16|90.72|91.60|94.24|92.56|93.28|90.64|91.44|91.12|88.56|88.88|87.92|90.32|91.04|88.72|85.44Microsoft Corporation|MSFT|299647.60|217.69|217.90|212.25|218.29|219.62|217.49|214.93|216.34|213.02|212.65|216.44|224.34|224.97|225.95|229.53|232.33|232.90|238.93|231.96BP p.l.c.|BP|248469.70|20.83|22.38|23.41|23.91|24.40|24.38|25.01|24.78|25.47|24.26|24.65|24.81|24.02|23.87|23.07|23.03|22.73|22.86| Computer ScienceEngineering & TechnologyPython Programming ECE 241
solved : QuestionHello! So I am trying to create a program in Python
How it works
- Paste your instructions in the instructions box. You can also attach an instructions file
- Select the writer category, deadline, education level and review the instructionsÂ
- Make a payment for the order to be assigned to a writer
- Â Download the paper after the writer uploads itÂ
Will the writer plagiarize my essay?
You will get a plagiarism-free paper and you can get an originality report upon request.
Is this service safe?
All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades
LET THE PROFESSIONALS WRITE YOUR PAPER!