Python Forum
Need some help with list and dictionary .txt - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Need some help with list and dictionary .txt (/thread-1683.html)



Need some help with list and dictionary .txt - GeekLife97 - Jan-20-2017

Hello buddies, I need some help with 4 questions , thanks for your time
 
Implement a program for:
• Read data in files of format similar to the examples provided
• Represent those data in appropriate structures (lists and dictionaries)
• Which company had most billing in month X?
• Which company had the most expenses in month X?

I really try to solve it but dont have ideia how to do .txt files and inplanted in the 2 last questions , can you help my guys ?





And the examples are :

""""
Company.txt

Company number                Company name

 12345678         --->       Stones Industry
 50609693         --->       Cakes and soda
 53453453         --->        Motos and cars

 """""
Movements.txt



FiscalNumber  Month      Billing     Expenses
12345678       1         3780,24       1839,75
50609693       1         7006,54       6500,34
12345678       2         4560,00       5640,54
53453453       1         13760,00      12049,62
12345678       3         7654,83       8732,99
53453453       2         15708,93      10495,00


""""


RE: Need some help with list and dictionary .txt - Larz60+ - Jan-20-2017

Please show the code that you have written so far
pointing out where you are having problems


RE: Need some help with list and dictionary .txt - Skaperen - Jan-20-2017

we can help you learn python, but the best use of time is to focus on the parts your class is using now.  what Larz60+ is asking for will be a big help.  posting other assignments and programs will help, too.


RE: Need some help with list and dictionary .txt - wavic - Jan-20-2017

How? The way we do it. Break the assignment into tiny steps. Open the file. Read it. Split the lines. Strip them. And so on.