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 loop 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

Answers

Answer 1

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()


Related Questions

Plz help the first and correct answer will be marked as brainliest answer

Answers

Answer:

1. desktop publishing

2. spreadsheet

3. research

4. entertainment

5. spreadsheet

6. database

7. word processing

8. desktop publishing

9. word processing

It's usually easier to change the design of a photo album slide show A.after you've created the presentation. B.before you've created the presentation. C.before you've planned out the presentation. D.after you've planned out the presentation but before creating it.

Answers

Answer:

A. after you've created the presentation.

Explanation:

A power point presentation is defined as a presentation program where one can create any presentation or design any layout like the photo album slide show to present it to others.

Once the album is created in the PowerPoint, it can be changed by going to the slide show and editing the content of the photo album of the slide show. Thus it is easier to make any changes in the design of the photo album slide show after the presentation have been created.

Which of the following is the BEST example of the principle of least privilege? Correct Answer: Wanda has been given access to the files that she needs for her job. Correct Answer: Mary has been given access to all of the file servers. Correct Answer: Jill has been given access to all of the files on one server. Correct Answer: Lenny has been given access to files that he does not need for his job.

Answers

Answer: Wanda has been given access to the files that she needs for her job.

Explanation:

The principle of least privilege is when a user is only given the minimum level of permissions that he or she needs to perform a particular job function. This helps in reducing the risk of attackers having access to data.

The best example of the principle of least privilege is Wanda has been given access to the files that she needs for her job. Given access to all of the file servers or access to all of the files on one server is incorrect.

Answer:

Wanda

Explanation:

Reason being is that least privilege gets only the things you need for the job, nothing more or less.

Which scenario would most benefit from a self-join query?
a. a query connecting customers and products
b. a query connecting supervisors and customers
c. a query connecting employees and their orders
d. a query connecting employees and their supervisors

Answers

Answer:

answer is D

Explanation:

Just did it on edge

what are the advantages of saving files in a cloud?
Please help!! ​

Answers

When using cloud storage, one of its main advantages is the accessibility and its ability to not get deleted as easily. Once a file is uploaded to the cloud, you can access it from almost any device as long as you have connection. And it’s not as easy from something to get accidentally deleted, as there is a backup.

who invented the system of logarithm in 1614 AD​

Answers

Answer:

JOHN NAPIER

Explanation:

The method of logarithms was publicly propounded by John Napier in 1614, in a book entitled Mirifici Logarithmorum Canonis Descriptio (Description of the Wonderful Rule of Logarithms). The book contained fifty-seven pages of explanatory matter and ninety pages of tables related to natural logarithms.

Answer:

Joost Bürgi

Explanation:

He invented it but John Napier worked on it earlier than Bürgi.

¿Qué algoritmos de encriptación utilizan una clave para cifrar los datos y una clave diferente para descifrarlos?

Answers

Answer:

Asimétrica

Explanation:

Los algoritmos de encriptación sirven para que solo el destinariario y receptor de los datos logren acceder a la información, es decir que inmediatamente que es enviada la información, solo puede ser legible para quien tenga un código de acceso, al mismo quien envía necesita una clave diferente para enviar lo datos. es un algoritmo asimétrico porqué el emisor y el receptor usan claves diferentes de encriptación.

write a program to enter length of a square and print area of square.
(class 8)​

Answers

Explanation:

Using python,

Length=int(input('Enter the length :'))

Breadth=int(input('Enter the breadth :'))

Area=length*breadth

print('The area is:' , Area)

Answer:

program by INPUT statement

Explanation:

CLS

REM to enter length of a square and print area of square.

INPUT "Enter length of a square"; l

LET Area of a square = l^2

PRINT " AOF "; Area of a square.

END

Write a loop that continually asks the user what food the user has in their refrigerator until the user enters apples, in which case the loop ends. It should acknowledge the user in the following format. For the first food, the user might say "hamburger," so your response would be, "You have a hamburger with a total of 1 food(s) if they enter hamburger, and so on until they enter “apples” at which point the loop ends. ---- make sure you save your file as "may28.py" *

Answers

(Disclaimer: I am not a professional, so it might not be the most concise answer possible, but I did run the Python script and it works)

Answer:

user_input = input("What food do you have in your refrigerator? ").lower()

count = 0

while True:

   if user_input != 'apples':

       count += 1

       print(f'You have a {user_input} with a total of {count} food(s)\n')

       user_input = input("What food do you have in your refrigerator? ")

   else:

       break

>What is the output of the following code:

list1 = [ 'cyber', 786 , 2.23, 'square', 70.2 ]
print (list1[1] )

Answers

Answer:

Given code output is "786".

Explanation:

Code:

list1 = [ 'cyber', 786 , 2.23, 'square', 70.2 ]#defining a list list1 that holds value in parameter

print (list1[1] )#use a print method that prints list index value

In the given code a list "list1" is declared that holds value in it and in the next step a print method is declared that prints the first index value of the list.

IT technicians are setting up a new file server for a school. Describe the benefits and
drawbacks of using a command line interface (CLI) rather than a graphical user interface
(GUI) to set up a new file server.

Answers

Answer:

The benefits of using the command line interface for setting up a file server are;

1) The command line interface (CLI) is faster than other interfaces and can easily handle tasks which are repeating such as creating folders for users on the server

2) The CLI requires less time for processing with the CPU, and it takes up less memory such that the file Server is not slowed down during the file setup process

3) The system resources required are few

The drawbacks are;

1) The CLI is confusing to those who are not exposed to programming as the commands the user needs to learn to before they can setup setup the new file server

2) The users needs to be very accurate in terms of spelling errors as that will lead to failure of the program, there are no spell check, and a mistype can lead to the entire coding process being restarted from the beginning

Explanation:

Match the network component to its function.

1. bridge amplifies network signals
2. gateway connects sections of a large network
3. NIC large computer that contains network resources
4. NOS translates data sent between networks
5. repeater connects nodes to the network
6. router directs network traffic
7. server connects one network to another
8. switch manages network devices

Answers

Answer:

where are the functions??

The network component is matched to its function as follows:

Repeater: amplifies network signals.Switch: connects sections of a large network.

What is a network component?

A network component can be defined as a set of hardware and software resources that makes up a computer network.

In Computer technology, the network component is matched to its function as follows:

Repeater: amplifies network signals.Bridge: it connects sections of a large network.Server: a large computer that contains network resources.Gateway: it translates data sent between networks.Network interface card (NIC): it connects nodes to the network.Switch: it directs network traffic.Router: it connects one network to another.Network operating system (NOS): it manages network devices.

Read more on network component here: https://brainly.com/question/10017822

#SPJ2

differentiate agricultural waste from hazardous waste.​

Answers

Mark Brainliest please

Answer :

Hazardous waste is waste that poses a severe threat to human health or the environment if improperly disposed of. According to the EPA, a substance is a hazardous waste if it appears on specific lists of hazardous waste or exhibits the established characteristics of hazardous waste. Hazardous waste is regulated under the Resource Conservation and Recovery Act (RCRA).

Agricultural waste is waste produced as a result of various agricultural operations. It includes manure and other wastes from farms, poultry houses and slaughterhouses; harvest waste; fertilizer run- off from fields; pesticides that enter into water, air or soils; and salt and silt drained from fields.




What is market information?

please answer in your own words since my teacher will probably notice if I plagerize

Answers

Answer:

Market information is is the understanding of the trends going on in a market such as demographic popular product age interests things like that

Explanation:

sign that your desktop may need cleaning​

Answers

Answer:

My desktop may need be cleaning but for real!!

_______ are pre-defined formats used to quickly format cells.

Cell formats
Cell styles
Style formats
Cell definitions

Answers

Answer:

Cell format

Explanation:

Cell formats refers to the various styling options which can be applied to cells in other to change the appearance and the way data is being presented. A number of cell formats are predefined in excel spreadsheet which can be applied directly to data in other to change it's appearance without applying manual changes. With predined cell formats gives several alignment option, Font size, color and setting, the fill color and border options. This can be directly applied to cells or tables to gives a good appearance of the data.

what is the best programming language

Answers

Answer:

Ther are 8 best programming language :

• Javascript

• Swift

• Scala

• Go

• Python

• Elm

• Ruby

• C#

Use the drop-down menus to complete the sentences describing the important ideas in Hess's theory. Hess expanded on Wegener's theory of continental drift . Hess proposed the idea that are places where crust is created.

Answers

Answer:

Following are the solution to the given question:

Explanation:

The hypothesis of continental drift from Wegener; Stein suggested that crust was formed within mid-ocean crises.

The first one is mainland drift, and the second is mid-ocean ridges. You have taken the test Use the dropdown menu to type out the phrase that describes Hess's theory as true major ideas.

Wegener's hypothesis of plate tectonics was expanded by Hess. Hess suggested that crust is produced in the mid-ocean ridges.

Answer:

Continental drift

mid-ocean ridges

Explanation:

How do you reset a g.mail password?

Answers

Answer:

put: forgot password to reset it

Answer:

Change your pass word

Open your Go ogle Account. You might need to sign in.

Under "Security," select Signing in to G oo gle.

Choose Password. You might need to sign in again.

Enter your new password, then select Change Password.

Tin học đã làm thay đổi công tác văn phòng ngày nay như thế nào?

Answers

Công nghệ đã thay đổi cách mọi người sử dụng để giao tiếp ở nơi làm việc hiện đại

If you see rough patches, loose,gravel,or potholes on the road you should

Answers

Answer:

move out of the way

Explanation:

Drive around them in the safest way as possible. if that is not an option then turn around in a nearby parking lot of some sort and take another road to your destination

What is the Full form of DC?

Answers

Answer:

Deputy Commissioner.

Answer:

the full form of DC is deputy commissioner

Write a structured algorithm that prompts the
user to input two numbers. The algorithm should
multiply both numbers and then prompt the
user to enter the answer. The algorithm should
compare the answer entered with that calculated
and output "correct answer" or "incorrect answer"
accordingly. At the start, input how many sums
will be done.

Answers

Answer:

Step 1 : Start

Step2 : Input first number, num1

Step3 : Input second number, num2

Step4 : product - - > num1 * num2 (product of num1 and num2)

Step5 : Input product, myanswer

Step6 : comparison - - - > correct or incorrect based on myanswer and product

Step6: print(comparison)

Step7: End

Explanation:

Algorithm is a sequence of instructions a computer is expected to follow to solve a particular problem.

Required :

Two inputs ; num1 and num2

Expected output

Algorithm :

Step 1 : Start

Step2 : Input first number, num1

Step3 : Input second number, num2

Step4 : product - - > num1 * num2 (product of num1 and num2)

Step5 : Input product, myanswer

Step6 : comparison - - - > correct or incorrect based on myanswer and product

Step6: print(comparison)

Step7: End

The two numbers to multiply are entered ; the product is calculated by the program ; the the user inputs his or her own expecteted product ;

Both are compared and the output of the comparison is displayed (either correct oe incorrect)

Vivian and other members of her group are attending an event where they have to give short, uninterrupted speeches, one after the other. The moderator has a passive role during the course of the discussion, he or she has to simply introduce the presenters and manage the time frame of the event. At the end of the discussion, the moderator engages with the presenters and audience to ask questions and point to areas of agreement or disagreement.

Vivian is part of a _____.

Answers

Answer:

Panel discussion at a symposium

Explanation:

A symposium is a discussion held in public and arranged so that groups of experts in a particular field of study can come together and present information, papers, discoveries, and new researches and also to provide recommendations as to what is and not to be done

A moderator for the symposium and the panel members usually seat in front of an audience to whom a prepared brief report is presented by the panel group members after which the key point may be summarized by the moderator and the audience can take part in asking questions which are answered by the panel members

Therefore;

Vivian is part of a panel discussion at a symposium

what do you mean by professional education? explain with examples.​

Answers

Answer:

prfesssional education is any programs that improve the knowledge,skills and attitudes.

Example include; educational course and training to become a teacher,nursing course,aeronautics engineering,etc.

Select the correct answer.

Susan is a programmer and uses the hexadecimal number system to represent instructions. Which letters of the alphabet do you think Susan uses to represent the numbers 10 to 15 in this number system?

A. A to F

B. A to H

C. A to M

D. A to J

Answers

Answer is  Hexadecimal  :     A.   A to F

Henry wants to use handheld computers to take customers' orders in her restaurant. He is thinking of using custom written, open source software. Describe what is meant by custom written software.

Answers

Answer: See explanation

Explanation:

Custom written software refers to the software that's developed for some particular organization or users. It's crates in order to meet the unique requirements of a business.

Since Henry is thinking of using custom written, open source software, then a custom written software will be used. Examples of custom written software will be automated invoicing, bug tracking software, E-commerce software solutions etc.

Two use of dovetail saw

Answers

Answer:

They are particularly use when it is use for cutting small or very precise cut. They are particularly use in joint making mostly dovetail joints

hope it helps

Complete the sentence
A _______ spans a geographic area like a city,is larger than a LAN and smaller than WAN

Answers

Answer:

metropolitan area network (MAN)

Explanation:

A local area network (LAN) refers to a group of personal computers (PCs) or terminals that are located within the same general area and connected by a common network cable (communication circuit), so that they can exchange information from one node of the network to another. A local area network (LAN) is typically used in small or limited areas such as a set of rooms, a single building, school, hospital, or a set of well-connected buildings.

On the other hand, a metropolitan area network (MAN) spans a geographic area like a city, is larger than a local area network (LAN) and smaller than wide area network (WAN).

Basically, a metropolitan area network (MAN) is formed by an aggregation of multiple local area network (LAN) that are interconnected using backbone provided by an internet service provider (ISP). A metropolitan area network (MAN) spans for about 5 kilometers to 50 kilometers in size.

pls any one what is pheumatic and hydrautic ​

Answers

Answer:

pheumatic is a branch of engineering that make use of gas

hydraulic is a technology and aplied science using engineering

Other Questions
If a + b = 2 and a - b = -4 what is the value of ab A. 5 B. -5 c.3 D. -3 What is the volume of the composite figure shown? Use 3.14 for . - Me escuchas?-S, ____ escucho atentamente.A. losB. nosC. meD. te Please help i need a complete answer In your opinion can science and religion coexist? Religion is based on faith, science on reason/proof? Are they in conflict? Cite to be a religious story/idea that seems to be against science. 1017 A sequence starts at 300 and 40 is subtracted each timee.30026022001800...The sequence continues in the same way,What is the first number in the sequence which is less than zerol?[11] Need help ASAP What is the total distance the monkey has traveled when she completes her 10th swing? Question 1 of 20 What did Cassie do during her date with Mitchell on Day Three? Industrialized CitiesWhat is the purpose of this source?O to describe the challenges faced by those livingoutside of the citiesO to show similarities in the living conditions of thoseinside and outside of the citiesThe industrial cities were different from those founded inearlier times. The modern downtown was created, and itwas connected to outlying areas by streetcars andcommuter rails. Middle-class professionals found it easyto get from their homes outside the city to their jobs, andback home at the end of the day.Not everyone was fortunate enough to live outside thecity. Working-class immigrant families lived in thepoorest parts of the city in tenement buildings that lackedlight and fresh air. As urban areas became more crowded,they grew more unsafe and unsanitary. Epidemics ofdiseases such as cholera and yellow fever spread quickly.Fires, crime, and poverty were common.to contrast the different living conditions for themiddle and working classesto show the positive effects of urbanization for thosewho lived in industrialized citiesIntro It twice the difference of a number and gig add to 4 the result is 22 more than four time the number. Find the number.PLEASE HELP!!!!!!!!!!!!!!!!!will mark brainlist Find the area of the circle.452.16 ft237.68 ft21808.64 ft2113.04 ft2 What process allows a single cell to grow into a multi-cellular organism? A manufacturer of cell phone screens is concerned because 12 percent of the screens manufactured using a previous process were rejected at the final inspection and could not be sold. A new process is introduced that is intended to reduce the proportion of rejected screens. After the process has been in place for several months a random sample of 100 screens is selected and inspected. Of the 100 screens 6 are rejected. What are the appropriate hypotheses to investigate whether the new process reduces the population proportion of screens that will be rejected?A. H0:p=0.12Ha:p0.12 BC. H0:p=0.06Ha:p0.06 DE. H0:p=0.12Ha:p help,its very important :) help help help help help help where does reabsorbtion of glucose take place?glomerulusbowman's capsule2nd coiled tubule1st coiled tubule Why did World War I deeply affect American modernist writers? Select all that apply.Many of the writers were unsure who won the war.They witnessed a war that killed and injured millions.Writers weren't allowed to write anything during the war.The established sense of order and traditional powers collapsed Match the below mention gas law.____________ states that the volume of a gas is directly proportional to the temperature of the gas, while pressure and number Of moles are kept constant (V/T = constant). All temperatures must be in kelvins when used in gas law calculations. __________ states that the volume of the gas varies inversely to the pressure on the gas, while temperature and number of moles are kept constant (PV = constant). ____________ states that the volume of a gas is directly proportional to the number of moles of the gas, while pressure and temperature are kept constant (V/n constant). 1. Boyle's law 2. Charles's law 3. Avogadro's law There are on average 43 g of sugar and 355 mL can of soda please calculate the molarity of sugar in the can of soda the molar mass of sugar is 342.2 g/mol A box with mass 25.14 kg is sliding at rest from the top of the slope with height 13.30 mand slope angle 30 degree, suppose the coefficient of friction of the slope surface is0.25, find (neglect air resistance,take g=10 m/s^2)The friction force experienced by the box.00) The acceleration of the box along the slope.(1) The time T required for the object to reach the bottom of the slope from the slope top. Explain why, when a force is applied to a piece of steel, it does not break but justchanges its shape. 234910-1NS-6-7-8-9Which three statements correctly describe key features of the function graphed here?