!!!Need Help for csv.DictReader problem!!

Joined
Aug 26, 2009
Messages
1
Reaction score
0
Find ten companies whose share prices earn the largest gain from 2006 to 2007. Sort the order of the companies based on the gain amount from the largest to the lowest.The program should produce text output similar to the format below:

--------------------------------------------------------------------
| No | Companies | 2006 Price | 2007 Price | Gain |
--------------------------------------------------------------------
| 1 | INCITEC PIVOT | 22.50 | 79.70 | 57.20 |

. . .

| 10 | COCA-COLA HELLENIC CDI | 35.68 | 50.50 | 14.82 |
--------------------------------------------------------------------

:oops:

i'm the beginning learner of csv,after i use dicreader to read the file, how to get the difference between 2007 and 2006? because 2007 and 2006 are in the same row........i'm really confused how to use dictionary to match the company name and the gain of the share price???? I have attached csv file~~~
 

Attachments

  • asx_2007.zip
    93.6 KB · Views: 272

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top