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
svet-max [94.6K]
3 years ago
10

Write a loop that displays your name 10 times. 2. Write a loop that displays all the odd numbers from 1 through 49. 3. Write a l

oop that displays every fifth number from 0 through 100. 4. Write a code sample that uses a loop to write the numbers from 1 through 10 to a file. 5. Assume that a file named People.txt contains a list of names. Write a code sample that uses a while loop to
Computers and Technology
1 answer:
irakobra [83]3 years ago
3 0

Answer:

The program in Python is as follows:

#1

for i in range(10):

   print("MrRoyal",end=" ")

print()    

#2

for i in range(1,50,2):

   print(i,end=" ")

print()

#3

for i in range(0,101,5):

   print(i,end=" ")

print()

#4

i = 1

while i <=10:

   print(i,end =" ")

   i+=1

#5

myfile = open("People.txt", "r")

eachLine = myfile.readline()

while eachLine:

   print(eachLine)

   eachLine = myfile.readline()

myfile.close()

Explanation:

The program in Python is as follows:

Program #1

This iterates from 1 to 10

for i in range(10):

This prints the name for each iteration [modify to your name]

   print("MrRoyal",end=" ")

This prints a new line

print()    

Program #2

This iterates from 1 to 49 with an increment of 2

for i in range(1,50,2):

This prints the odd numbers in the above range

   print(i,end=" ")

This prints a new line

print()

Program #3

This iterates from 0 to 100 with a step of 5

for i in range(0,101,5):

This prints every 5th number

   print(i,end=" ")

Print a new line

print()

Program #4

This initializes the number to 1

i = 1

This opens the file in an append mode

f = open("myfile.txt", "a")

This loop is repeated from 1 to 10

while i <=10:

This writes each number to the file

   f.write(str(i))

Increment the number by 1

   i+=1

Close the file

f.close()

Program #5

This opens the file in a read mode

myfile = open("People.txt", "r")

This reads each line

eachLine = myfile.readline()

This loop is repeated for every line

while eachLine:

Print the content on the line

   print(eachLine)

Read another line

   eachLine = myfile.readline()

Close the file

myfile.close()

You might be interested in
is an interviewing method in which a mall interviewer intercepts and directs willing respondents to nearby computers where each
geniusboy [140]

Answer:

computer-assisted self-interviewing

Explanation:

Based on the description of the interviewing method that is being provided, it can be said that this method is known as computer-assisted self-interviewing. Like mentioned in the question this is when interviewees answer the interview questions through a computer screen. This is similar to telephone interviews but it is instead through a computer.

3 0
3 years ago
What is the recommended size for bulleted text? 12–22 24–40 44–66 54–80
algol [13]
44–66

According to sources, the most probable answer to this query is 44–66 point size.
This is because the eyes and the illustration should match the proportion of distance and height factors.
Thank you for your question. Please don't hesitate to ask in Brainly your queries. 
5 0
3 years ago
A product/process is referred to as a Key Technology during which of the following phases of the technology development cycle?
Galina-37 [17]
The answer is C. Mature phase.
3 0
3 years ago
Read 2 more answers
To comply with ATC instructions for altitude changes of more than 1,000 feet, what rate of climb or descent should be used?
jasenka [17]

Answer:

B

Explanation:

5 0
3 years ago
A main reason careers in Information Technology are growing faster than average is
Scorpion4ik [409]
Technology has become such a major part of everyday life
8 0
3 years ago
Other questions:
  • Achieving a degree in computer forensics, information technology, or even information systems can provide a strong foundation in
    11·1 answer
  • Shelly praised Susan via email for how well she executed an employee training program last week. Shelly is engaging in the _____
    6·1 answer
  • You must have an active ____ to test external links.
    5·1 answer
  • Write a generator function named count_seq that doesn't take any parameters and generates a sequence that starts like this: 2, 1
    7·1 answer
  • Why do you classify computers?
    6·1 answer
  • PLEASE SOMEONE ANSWER THIS
    8·2 answers
  • As a student, how can you sustain focus and attention with technology distracting you from things that matter (academic, persona
    7·1 answer
  • In order to restrict editing to a document, a user will go to Review, , Restrict Editing, and will then select what kinds of edi
    12·1 answer
  • Explain why the operating system hides certain folders ​
    5·1 answer
  • Which kind of a person will you be if you prove to be accountable for your actions?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!