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
gulaghasi [49]
3 years ago
5

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 read the file and display its contents in a ListBox control.
Computers and Technology
1 answer:
monitta3 years ago
6 0

Answer:

Kindly check explanation

Explanation:

(1.)

n = 0

While n < 10 :

n+=1

print('fichoh')

# initiate counter n = 0 ; set condition, while n is not equal to 10 ; it print 'fichoh' and counter is increased by 1. This terminates once it reaches 10.

(2.)

for number in range(1,50):

if number%2 != 0 :

print(number)

#An odd number won't have a remainder of 0 when Divided by 2 ; so, for numbers 1 to 49 using the range function, if the number is divided by 2 and leaves a remainder other Than 0, such number is displayed

(3.)

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

print(number)

# Using the range function, starting from 0 to 100; it is number in the for loop is incremented by 5 and displayed.

(4.)

outfile = open('my_file.txt', 'w')

for n in range(0,11):

outfile.write(str(n))

outfile.close()

#open, 'w' creates a text file, my_text.txt and writes into it ; using the range function, numbers 0 to 10 is written into the created file.

5.)

name_file = open('People.txt', 'r')

While name_file:

out_file = name_file.readline()

if out_file = ' ' :

break

name_file.close()

names = name

#Open, 'r' ; opens and read from the file People.txt ;

#readline reads the content of the opened text file into a list out_file ; using the if ' ', the loop terminates once an empty content is read.

You might be interested in
You have a multi-domain Windows Server 2016 forest. You need to make a shared folder available to users from several domains. Wh
Darina [25.2K]

Answer:

Universal

Explanation:

The active directory has the following group scopes based on the level the group will be granted permission;

Universal

Global

Domain Local

With the Universal group all accounts within the domains located in the network forest can be added as well as Global groups and Universal groups within the same forest can be added. Members in the Universal group can be granted permissions to the resources on any domain located in the forest.

6 0
3 years ago
Please help! i need this very quickly
Savatey [412]
Edit the shape to be merged
5 0
2 years ago
Read 2 more answers
Ken is a mobile app developer. He is designing a mobile app that offers tips and guidance to people interested in learning jazz
Luden [163]

Answer:

D is the one that makes the most sense

3 0
3 years ago
Read 2 more answers
Which of the following activities are performed by computer programmers? Choose all that apply.
AleksAgata [21]

Answer:

- They write step by step instructions for a computer to follow.

- They create a logic problem that the computer program can solve.

3 0
3 years ago
A teacher at your school is using her district issued laptop to create spreadsheets for her part-time job as a bookkeeper. Which
Alenkasestr [34]

Answer:

The teacher is most likely violating the District Use Policy.

5 0
2 years ago
Other questions:
  • The mass of a textbook is about 1.25 kilograms. Aproximately, how many ounces is this?
    10·1 answer
  • When you select a state abbreviation from a combo box, how does the form control record your selection?
    8·1 answer
  • If I was to sort the months of the year in ASCENDING order alphabetically, which
    11·1 answer
  • The temperature in toronto canada was-4°c and tje temperature in brixton,england was 6°c warmer. what was the difference in temp
    11·1 answer
  • Please help will give brainliest
    12·1 answer
  • Which of the following networks had these two goals: a) allowing scientists to work together on scientific projects; and, b) fun
    8·2 answers
  • Draw
    7·1 answer
  • What is a reason for zipping a file?A. to encrypt themB. to return them to their original sizeC. so they display properly on a W
    7·1 answer
  • What is the destination ip address when an ipv4 host sends a dhcpdiscover message?
    6·1 answer
  • 18. which of these components is responsible for providing instructions and processing for a computer? a. cpu b. ssd c. ram d. r
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!