1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lerok [7]
4 years ago
6

Write a basic program that performs simple file and mathematical operations.

Computers and Technology
1 answer:
Ostrovityanka [42]4 years ago
7 0

Answer:

Explanation:

I have written the Python program based on your requirements.

Just give the path of the input file and the path for the output file correctly where you want to place the output file.

In, my code - I have given my computer's path to the input and output file.

You just change the path correctly

My code works perfectly and I have tested the code with your inputs.

It gives the exact output that you need.

I have attached the Output that I got by running the below program.

Code:

month_list={ "january":"1","february":"2", "march":"3","april":"4", "may":"5", "june":"6","july":"7", "august":"8", "september":"9","october":"10", "november":"11", "december":"12"} input_file=open('C:\\Users\\Desktop\\inputDates.txt', 'r') output_file=open('C:\\Users\\Desktop\\parsedDates.txt','w') for each in input_file: if each!="-1": lis=each.split() if len (lis) >=3: month=lis [0] day=lis[1] year=lis [2] if month.lower() in month_list: comma=day[-1] if comma==',': day=day[:len (day)-1] month_number=month_list[month.lower()] ans-month_number+"/"+day+"/"+year output_file.write (ans) output_file.write("\n") output_file.close() input_file.close()

- O X parsedDates - Notepad File Edit Format View Help 3/1/1990 12/13/2003

- X inputDates - Notepad File Edit Format View Help March 1, 1990 April 2 1995 7/15/20 December 13, 2003 -1

cheers i hope this helped !!

You might be interested in
Click _______ to add a new column to a table.
Sophie [7]
The answer is Insert control B

5 0
4 years ago
Read 2 more answers
1 bulb controlled by 2-three way switches using 12 volts battery.<br><br> pahelp po
marta [7]

Answer:

Ok so what I can do for this question

5 0
3 years ago
Explain why computer systems utilize digital instead of analog signals
KiRa [710]
Analog signals are MUCH harder to determine a discreet value from. By nature, analog's voltages just kind of flow into each other. Digital is very simple: voltage and it's on, logical one; no voltage, it's off, logical zero.
4 0
3 years ago
Web browsers are used to browse the world wide web.
VikaD [51]
No its actually used for looking up concerns, questions, or rumours
3 0
4 years ago
Read 2 more answers
In popular usage and in the media, the term ________ often describes someone who breaks into a computer system without authoriza
ch4aika [34]
The answer here is hacker
6 0
3 years ago
Other questions:
  • B. Write a function that takes one double parameter, and returns a char. The parameter represents a grade, and the char represen
    7·1 answer
  • The difference between the various networks is the ______ of the coverage.
    11·2 answers
  • What is the first step in planning a multi-table query?
    14·1 answer
  • What are the flowchart symbols?​
    6·1 answer
  • Which leader of the Jamestown colony am I?
    15·2 answers
  • Clunker Motors Inc. is recalling all vehicles from model years 1995-1998 and 2004-2006. A boolean variable named recalled has be
    8·1 answer
  • How many bits long is a autonomous system number?
    13·1 answer
  • Related to Image Classification
    13·1 answer
  • What are the types of micro computer?​
    14·2 answers
  • Transitive spread refers to the effect of the original things transmitted to the associate things through the material, energy o
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!