Python Forum

Full Version: Need some help with list and dictionary .txt
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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


""""
Please show the code that you have written so far
pointing out where you are having problems
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.
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.