Python Forum
Need some help with list and dictionary .txt
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need some help with list and dictionary .txt
#1
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


""""
Reply
#2
Please show the code that you have written so far
pointing out where you are having problems
Reply
#3
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.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
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.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Loop through elements of list and include as value in the dictionary Rupini 3 2,588 Jun-13-2020, 05:43 AM
Last Post: buran
  How can details be dynamically entered into a list and displayed using a dictionary? Pranav 5 2,860 Mar-02-2020, 10:17 AM
Last Post: buran
  Functions returns content of dictionary as sorted list kyletremblay15 1 2,005 Nov-21-2019, 10:06 PM
Last Post: ichabod801
  Dictionary/List Homework ImLearningPython 22 10,358 Dec-17-2018, 12:12 AM
Last Post: ImLearningPython
  making a dictionary from a list, one key with multiple values in a list within a list rhai 4 3,546 Oct-24-2018, 06:40 PM
Last Post: LeSchakal

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020