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
nordsb [41]
3 years ago
7

Write a script named numberlines.py. This script creates a program listing from a source program. This script should: Prompt the

user for the names of two files. The input filename could be the name of the script itself, but be careful to use a different output filename! The script copies the lines of text from the input file to the output file, numbering each line as it goes. The line numbers should be right-justified in 4 columns, so that the format of a line in the output file looks like this example: 1> This is the first line of text
Computers and Technology
1 answer:
ddd [48]3 years ago
4 0

Answer:

See explaination for program code.

Explanation:

inputFileName = input("Input filename: ") outputFileName = input("Output filename: ") inputFile = open(inputFileName, "r") outputFile = open(outputFileName, "w") count = 1 for line in inputFile: newLine = str(count).rjust(4, " ") + "> " + line outputFile.write(newLine) print(newLine) count += 1

You might be interested in
Lynn has created a quarterly sales report using a word processor. The document is confidential, and Lynn wants to secure it with
sweet-ann [11.9K]
Stop cheating



It’s b
3 0
2 years ago
Easy 25 points answer what is it called that you use only 1 and 0 like this 1010010011001100011110001010010101001010101010010101
Arlecino [84]
Binary. Is the correct answe
3 0
4 years ago
Q1. Information systems that monitor the elementary activities and transactions of the organizations are: I a. Management-level
VashaNatasha [74]

Answer:

B. Operational-level systems monitor the elementary activities and transactions of the organization.

6 0
2 years ago
What is the symbol for the relational operator 'equal to'?
rosijanka [135]
= hope this help :) :)
6 0
3 years ago
. Java is a high-level language.. true or false?
frutty [35]

Answer:

the answer is true. it is a high level language

4 0
3 years ago
Other questions:
  • Define the following term: - hue
    11·2 answers
  • A way to minimize technical problems with your computer
    14·1 answer
  • You have a number of digital pictures you recently took on your smartphone. You would like to share these pictures with all of y
    11·1 answer
  • how to answer the questions on brainly? I've typed my answer in the box but there's no submit button or whatever, and the only t
    14·2 answers
  • What is the Documenter?
    10·1 answer
  • In the event you get pulled over for a traffic stop, describe the situation from the police officer's perspective and list at le
    6·2 answers
  • In a ______topology, every device has exactly two neighbors for communication purposes. A failure in any cable or device can tak
    15·2 answers
  • This is using python.
    5·2 answers
  • Which of the following technologies is an example of social media
    12·1 answer
  • question 5 you need to find the internet protocol (ip) address for a website. which command do you use on a windows system?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!