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
Jake is preparing his resume. He is applying for the position of iOS application developer at a large software company. He wants
gavmur [86]

Answer:

C. Modern Programming Language Skills

Explanation:

4 0
3 years ago
What types of files we do backup in UNIX and Linux?
katrin [286]

Answer:

Nas ja kaki yawe diy. Kitu mu chuk k a jana a.

Explanation:

Karu explain pudi diya chal puter chuti kar.

8 0
3 years ago
Read 2 more answers
What a suitable variable name to store the number of years old a person is
navik [9.2K]

age is a suitable variable name. It's descriptive and concise. Make sure it's lowercase.

8 0
3 years ago
With more and more users using mobile to look at websites, it is key that you optimise your site so users can find it when searc
inessss [21]

Answer:

Site speed and usability.

Explanation:

Web pages are developed using web development tools like HTML, CSS, JavaScript etc. A collection of these web pages are called a website. The web is a hosted for internet use in a web server.

All requests for a website in a web server is done in a web browser in a client device. For a website to be easy searched for , the search engine optimisation technique is used.

A hosted website on a server must have a unique and usable domain name and the page loading on a browser should be made faster by optimising the size of the scripting language.

3 0
3 years ago
Eric is working on a computer that has a device driver error. Eric can find the name of the device driver however the actual dev
wel

Answer:

Windows\System32\drivers folder.

Explanation:

Eric operates on such a computer which has some failure on system's driver. Although the specific system may not be operational, he will locate the system driver title. Inappropriately he has no Connectivity to the internet.

Windows\System32\drivers directory could move to him to show the file of the system driver. Thus, the following answer is correct according to the given scenario.

3 0
3 years ago
Other questions:
  • When called upon to give an impromptu speech, it is a good idea to do all of the following, except:
    11·2 answers
  • When naming a file you should use the _____________ instead of a space in a filename.
    6·1 answer
  • Creating a map of your current knowledge is called __________.
    12·1 answer
  • A forensics workstation consisting of a laptop computer with almost as many bays and peripherals as a stationary workstation is
    10·1 answer
  • Write a program to calculate and return total surface area of a box using FUNCTION _END FUNCTION.​
    15·1 answer
  • Your customer, Mykel, is ordering a custom-built computer for his home office and isn’t sure which components should be the high
    12·1 answer
  • Jim is expecting a very busy weekend at his store, so he sent the following e-mail to his employees: ALL EMPLOYEES MUST WORK THI
    6·1 answer
  • A law office has been leasing dark fiber from a local telecommunications company to connect a remote office to company headquart
    14·1 answer
  • Experienced students may serve as mentors if they are at least age 21 and have at least 3 years of post-secondary education. In
    5·1 answer
  • James root lol ........................
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!