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
bazaltina [42]
4 years ago
11

Write a short program that uses a for loop to write the numbers 1 through 10 to a file

Computers and Technology
1 answer:
Kamila [148]4 years ago
5 0
An example would be as follows:

<span>outfile = open('filename.txt', 'w')
for num in range (1, 11):
outfile.write(str(num) + '\n')
outfile.close()

And a second example:

</span><span>dataFile = open("filename", "w")
for line in range(11):
    dataFile.write("%s\n" % line)
dataFile.close<span>()</span></span><span>

Hope this helps.</span>
You might be interested in
What is the main purpose of adding captions to an image or table in Word?
Wittaler [7]

Answer: c

Explanation:

7 0
3 years ago
After saving the changes she made, Sally notices that she used the word "home” too many times in her paragraph. She decides to m
Natasha_Volkova [10]

Answer:

c or a there both correct

Explanation:

8 0
4 years ago
Why was unicode invented
GrogVix [38]
The old system, ASII, was no where near large enough to deal with all the different languages & symbols that exist  
5 0
4 years ago
Read 2 more answers
Suppose that a main method encounters the statement t3.join(); Suppose that thread t3's run() method has completed running. What
Slav-nsk [51]

Answer:

C. The main method proceeds to the next statement following the t3.join(); statement

Explanation:

join() method allows the thread to wait for another thread and completes its execution. If the thread object is executing, then t3.join() will make that t is terminated before the program executes the instruction. Thread provides the method which allows one thread to another complete its execution. If t is a thread object then t.join() will make that t is terminated before the next instruction. There are three overloaded functions.

join()

join(long mills)

join(long millis, int Nanos)

If multiple threads call the join() methods, then overloading allows the programmer to specify the period. Join is dependent on the OS and will wait .

8 0
4 years ago
A __________ is created by using a secure hash function to generate a hash value for a message and then encrypting the hash code
Maslowich
A Cryptographich hash is created by using a secure hash function to generate a hash value for a message and then encrypting the hash code with a private key.
3 0
3 years ago
Other questions:
  • which resource do programmers sometimes have to refer to and use during planning the logical steps of the solution
    15·2 answers
  • What is a device driver?
    9·2 answers
  • How do you create a logo on Adobe illustrator
    8·1 answer
  • Which of the following controls will provide an area in the form for the user to enter a name? a. button b. label c. text box d.
    8·1 answer
  • Assume that price is an integer variable whose value is the price (in US currency) in cents of an item. Write a statement that p
    8·1 answer
  • ________ is a programming language invented by netscape used to control the objects on an html page and handle interactions with
    5·1 answer
  • Three common risk factors for young drivers and how you plan to minimize these factors.
    13·1 answer
  • The Quick Access tool bar allows you to customize the actions or commands you frequently use.
    13·1 answer
  • Which of the following is NOT present on the Title Bar?​
    7·1 answer
  • How to run angular project from github.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!