Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

DOW at the End of 2013 - TheDOW.txt Download DOW.txtdata set contains the name, symbol, exchange, industry, the price at the end of trading on 31 Dec 2012, the price at the end of trading on 31 Dec...

1 answer below »
  1. DOW at the End of 2013- TheDOW.txtDownload DOW.txtdata set contains the name, symbol, exchange, industry, the price at the end of trading on 31 Dec 2012, the price at the end of trading on 31 Dec 2013, 2013 earnings per share, and the dividend paid in 2013 for each of the 30 stocks in the Dow Jones Industrial Average. The first three lines of the file are shown below.
     American Express,AXP,NYSE,Consumer finance,57.48,90.73,4.88,0.89
Boeing,BA,NYSE,Aerospace & defense,75.36,136.49,5.96,2.19
Caterpillar,CAT,NYSE,Construction & mining equipment,89.61,90.81,5.75,2.32

Write a program that displays the stock symbol for all 30 companies in a 3 X 10 table. Ask the user to enter a symbol and then display the details for that company. The sample output for one user session is as follows:

Symbols for the Thirty DOW Stocks
AXP BA CAT CSCO CVX DD DIS GE GS HD
IBM INTC JNJ JPM KO MCD MMM MRK MSFT NKE
PFE PG T TRV UNH UTX V VZ WMT XOM
Enter a symbol: MCD
Company: McDonald's
Industry: Fast food
Exchange: NYSE
Growth in 2013: 10.00%
Price/Earnings ratio in 2013: 17.48
Answered Same Day Sep 25, 2021

Solution

Yogesh answered on Sep 25 2021
148 Votes
temp_list = []
file = open("dow.txt")
for line in file:
    line = line.split(",")
    temp_list.append(line)
lines = len(temp_list)
###Print symbols in 3x10 table
print("Symbols for the Thirty DOW Stocks: ")
for y in range(int(lines/10)):
    for i in range(10):
        print(temp_list[i+(y*10)][1],...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here