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
Why do people post about family problems?
kvv77 [185]

Answer:

Some people go through things either traumatizing or painful to them emotionally/mentally past or future. They seek comfort or a feeling thatll make them feel safe for a moment and have comfort from the fear of what may be outside there door wherther its abuse mentally or physically.

4 0
3 years ago
To iterate through (access all the entries of) a two-dimensional arrays you
ahrayia [7]

Answer: You would need two loops to iterate through both dimensions

Explanation:

matrix = [[1,2,3,4,5],

              [6,7,8,9,10],

              [11,12,13,14,15]]

for rows in matrix:

    for numbers in rows:

         print(numbers)

The first loop cycles through all the immediate subjects in it, which are the three lists. The second loop calls the for loop variable and iterates through each individual subject because they are lists. So the first loop iterates through the 1st dimension (the lists) and the seconds loop iterates through the 2nd dimension (the numbers in the lists).

6 0
3 years ago
The correct syntax for accessing the length of an array named numbers is:
Sladkaya [172]
The syntax is truly dependent on the programming language, as different languages have different API's. 

But, the most standard form of accessing an array length is via a method or property by dot notation.

For example -

for(int i = 0; i <= m_Array.Length; i++) {...}

This code is from C#, using the Length property.
3 0
3 years ago
I need help can someone help
Alona [7]

Answer:

Bank Reconciliation

Explanation:

I think

8 0
2 years ago
2.how was information conveyed in the Google Earth tour about Egyptian pyramids?
hoa [83]
 An important criterion for evaluating the effectiveness of a graphic organizer is B. How well it conveys information. The number of words, color and the number of pages are just secondary compared to B. Google Earth showed the image of terrains and location to know more about the Egyptian pyramids

6 0
3 years ago
Read 2 more answers
Other questions:
  • A production house needs an operating system that captures, saves, and generates information within a specific time. Which type
    5·1 answer
  • A man travel 200m towards east&lt;br /&gt;from his house then takes left&lt;br /&gt;to turn and moves 200 m north&lt;br /&gt;fin
    14·1 answer
  • Software engineering design teams use ________, which are grounded in mathematical concepts of sets and relations, for their sof
    13·1 answer
  • You get a BRAINLIEST if you help me ASAP!
    11·2 answers
  • What are some differences between CUI and GUI ?
    7·1 answer
  • Which part of a computer takes the text and pictures on your screen and prints them onto paper?
    6·1 answer
  • Which devices are most likely to communicate with the internet? Select 3 options.
    13·1 answer
  • Sergio knows that to meet the project requirements, it is essential to have
    9·1 answer
  • a network administrator for a large oil company has discovered that a host on the company network has been compromised by an att
    15·1 answer
  • what statement about constructors is false? group of answer choices all constructors are passed a pointer argument constructors
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!