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 practices will help you avoid sending out e-mail to the wrong person?
wel
Check who you are sending it to before you hit send 
5 0
3 years ago
If you delete selected cells using the Delete key on your keyboard, only the _______ of the cells is removed. formatting content
kap26 [50]
If you delete selected cells using the Delete key on your keyboard, only the _______ of the cells is removed.
Content
8 0
3 years ago
Read 2 more answers
Which of the following assessments uses computer-adaptive technology to provide questions? SAT, ACT, ASVAB, or ACCUPLACER?
never [62]
ACCUPLACER, I hope this helps :)
7 0
3 years ago
Read 2 more answers
The process of a web server adding a tcp header to a web page, followed by adding an ip header, and then a data link header and
kumpel [21]
<span>Encapsulation is defined as the process of adding a header in front of data supplied by a higher layer (and possibly adding a trailer as well).</span>
7 0
3 years ago
Which security measure provides protection from IP spoofing?
anyanavicka [17]

Answer:

An SSL also provides protection from IP spoofing.

8 0
3 years ago
Other questions:
  • Of the two basic methods of data entry, keyboards use keystrokes to enter data and instructions; what is the nonkeyboard method
    7·1 answer
  • What is the penalty for refusing to submit to alcohol testing (drivers ed)
    7·2 answers
  • What does AAC stand for?
    11·2 answers
  • When an interrogator speaks highly about how a crime was committed, hoping to get the suspect to brag about his or her involveme
    7·2 answers
  • Which of the following is an example of hypertext pattern reading?
    13·1 answer
  • As part of a team, you are assigned to create a financial report. One of your tasks is to put the pieces together as other team
    5·1 answer
  • What happens when text is added to grouped objects that is larger than an object ?
    9·2 answers
  • 9. These particular machines can be decentralized.
    9·1 answer
  • (--BRAINLIEST--)<br>Explain the types of secondary memory on the basis of data access.​
    8·2 answers
  • A diagram of a ten-node network that uses ten routers
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!