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
Yuri [45]
3 years ago
7

Write code that does the following: opens an output file with the filename numbers.txt , uses a loop to write the numbers 1 thro

ugh 100 to the file, and then closes the file.
Computers and Technology
2 answers:
kirza4 [7]3 years ago
4 0

Answer:

numbersFile=open("numbers.txt","w")

for i in range(1,101):

   

   numbersFile.write("%s\n" % i)

numbersFile.close()

Explanation:

The programming language used here is python,.

The first line opens a file numbers.txt in the write mode (w), which means you can add new lines of text to the file.

In the second line, the range function is used with a FOR loop to generate a range of numbers from 1 through 100.

In the third line, the program adds all the numbers generated by the range and FOR loop to the txt file, and finally the file is closed.

otez555 [7]3 years ago
3 0
#include <iostream> #<span>include <fstream> </span>using<span> namespace std; int main( int argc, ... </span>outputFile.open( "<span>primeNumbers.txt" ); //

Maybe this will help :)</span>
You might be interested in
What are the origins of the parking barrier?
Volgvan
Is there a photo we can see?
8 0
3 years ago
12. Because Java byte code is the same on all computers, compiled Java programs a. are nonexistent b. must be re-compiled for ea
GenaCL600 [577]

Answer:

C) Highly portable

Explanation:

This means they can run on any computer or platform that supports Java without the need for recompillation.

This idea is popularly called WORA that is Write Once Run Anywhere.

Software Applications written in Java are compiled to bytcode (.class) which are intended to run on the Java Virtual Machine (JVM) irrespective of the architecture of the computer or device.

5 0
3 years ago
Display ad traffic from mobile devices may appear to be unprofitable, but the ads might be profitable if
Svetlanka [38]

Answer:

They meet required amount of traffic or clicks.

Explanation:

AdSense is an advertisement platform for businesses. It advertises the registered business on various target client platform like mobile app and web app who allow these adverts for profit with a commission rate for a certain amount of traffic generated from the platform on the advertised business.

6 0
3 years ago
_______ provide additional information and request user input.
lapo4ka [179]
The Dialog Box gives extra data and demand client input. The Dialog Box is thought to be a transitory window an application makes to recover client input. An application regularly utilizes exchange boxes to incite the client for extra data for menu things. An exchange box for the most part contains at least one controls with which the client enters content, picks alternatives, or coordinates the activity.
4 0
4 years ago
Read 2 more answers
Which Of these best describes what a binary digit can store?
Sholpan [36]

Answer:

A

Explanation:

binary is in the root of 2 so it's only having values 1 and 0

8 0
3 years ago
Other questions:
  • A range of cells can be converted into an Excel ________ so that the data can be analyzed
    7·1 answer
  • How to download goose simulator the game for free<br><br>pls tell me
    6·2 answers
  • Which recovery method usually involves an evasion effort and is dependent on the ip's condition?
    11·1 answer
  • What data type can be used to hold any single character, including numbers and non-printing characters?
    15·2 answers
  • Cómo mi dificar el aspecto del texto​
    12·2 answers
  • Which of the following commands appears in the INSERT menu or tab?
    10·1 answer
  • What is computer forensics? Where and how would an IT auditor use thisresource?
    12·1 answer
  • If ClassC is derived from ClassB which is derived from ClassA, this would be an example of ________.
    7·1 answer
  • Is the following statement true or false? The message you send, the message you intend to
    5·1 answer
  • How have cell phones improved our lives​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!