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

Write a pseudocode to calculate the factorial of a number

Answers

Answer:

Answer CODE from C# Sharp  Language

Explanation:

using System;

namespace test

{

   class Program

   {

       public void silnia()

       {

           decimal liczba;

           decimal silnia = 1;

           Console.WriteLine("Obliczanie Silni ");

           Console.WriteLine("Podaj liczbę: ");

           liczba = Convert.ToInt32(System.Console.ReadLine());

           //liczba = int.Parse(Console.ReadLine());

           for (int i = 1; i <= liczba; i++)

               silnia *= i;

           Console.WriteLine("Wynik Silni Wynosi :  " +silnia +" \n ");

       }

       static Program ćwiczeniaA;

       static void Main(string[] args)

       {

           ćwiczeniaA = new Program();

           ćwiczeniaA.silnia();

       

           Console.WriteLine("Koniec Programu");

           System.Console.ReadLine();

       }                                

   }

}

Your company resides in an area with rapid growth in both the corporate and residential areas surrounding your office. As such, your company has been experiencing several brownouts due to power grid problems (too much demand and not enough electricity). Fearing that your computers (especially the servers) could be damaged by these brownouts, your manager has asked you to find a solution to this problem.
Which of the following would be the BEST device to recommend to your manager for computer protection?
A. Surge suppressor
B. Power strips
C. UPS
D. Wall Outlet

Answers

Answer:

The correct answer is option C (UPS).

Explanation:

Since brownouts are reduced voltages that might not be good enough for the required electricity capacity for your company, fearing that your computers (especially the servers) could be damaged, it is best to use UPS for your computer protection.

A UPS also called (Uninterruptable Power Supply) can function as a Surge suppressor when the voltages entering your company might be higher than normal, it can also function too in protecting your computers (especially the servers) in the case of a brownout when voltage required by your computers dropped below the required level. In the case of a brownout, the  UPS supplies energy stored in its batteries to make the computers keep working without going off from lack of electricity.

complete the sentence: hexadecimal numbers use base ____

Answers

Hexadecimal numbers use base-16

Being a Base-16 system, the hexadecimal numbering system therefore uses 16 (sixteen) different digits with a combination of numbers from 0 through to 15. In other words, there are 16 possible digit symbols.

A car manufacturer uses'simulation software during the design process for a new car. Which of the
following are reasons to use simulation software in this context?
1. Using simulation software can save the company money by helping to compare designs early in
the process, before prototype cars are built.
II. Using simulation software can help to identify safety issues by providing data about how different
mechanical components will interact in a wide variety of situations.
III. The manufacturer can present simulation software to customers to demonstrate different design
possibilities
А
I and II only
B
I and III only
С
II and III only
D
I, II, and III

Answers

D I,II and III is the answer i think

The reasons to use simulation software in this context are I, II, and III. The correct option is D.

What is simulation software?

The process of simulating a genuine phenomenon with a set of mathematical formulas is the foundation of simulation software. It is essentially a program that allows the user to simulate an operation and view it without really conducting it.

Simulation is a decision-making and decision-support tool. You can use simulation software to assess, compare, and optimize different designs, programs, and policies. As such, it can be used to explain and defend decisions to multiple stakeholders.

By allowing the corporation to evaluate concepts early in the process before prototype automobiles are constructed, simulation software can save the company money.

Therefore, the correct option is D, I, II, and III.

To learn more about simulation software, refer to the link:

https://brainly.com/question/16192324

#SPJ2

State two pieces of information that need to be labeled on the idea development sketch. 1 .________________________________________________. 2 .___________________________________________.​

Answers

Answer:

Design drawings should show details on layout, measurements, plan, cross-sectional and vertical profiles. This information is prepared as scale drawings of the works to be constructed. they are legible  they include all information from previous revisions and updates.

Explanation:

Can someone please type a code that makes a house in python and turtle graphics i need help

Answers

Answer:

import turtle  

turtle.speed(2)

#shape

turtle.forward(100)

turtle.left(90)

turtle.forward(100)

turtle.left(45)

turtle.forward(100)

turtle.left(90)

turtle.forward(100)

turtle.left(45)

turtle.forward(100)

turtle.left(90)

turtle.forward(100)

#door

turtle.left(90)

turtle.forward(50)

turtle.left(90)

turtle.forward(25)

turtle.left(90)

turtle.forward(50)

#windows

turtle.penup()

turtle.right(90)

turtle.forward(20)

turtle.right(90)

turtle.forward(20)

turtle.pendown()

turtle.forward(25)

turtle.left(90)

turtle.forward(40)

turtle.left(90)

turtle.forward(25)

turtle.left(90)

turtle.forward(40)

Explanation:

here :)

Other Questions
15Type the correct answer in each box. If necessary, round your answer(s) to the nearest hundredth.The vertices of ABC are Al-2, 2), B6, 2), and 90, 8). The perimeter of ABC isunits, and its area issquare units. In your opinion, which is most important? And why?lawyerengineerdoctorscientist artist A 21-year-old woman presents with a 3-month history of a black mole on her right calf. She tells you that the lesion is enlarging and expanding. It began to itch about 3 weeks ago, and it has bled 2 times. She thinks that there may have been a mole near the same spot previously, but she is not certain. Her general health is good; there is no history of chronic illness, hospitalizations, or surgeries. She works as a professional model for a large advertisement agency. She does not take any prescription medication; she does not use tobacco, alcohol, or recreational drugs. Although she has dark hair, she has a fair skin, and she says that she usually burns with even short sun exposure. She does occasionally use a tanning booth prior to modeling events and vacations. There is no family history of skin cancer.VS stable, she looks anxious, but she is otherwise well.There is a dark brown-black nodule on the right calf 1 cm in diameter.On the surface of the nodule, there is a tiny area of crusting. There are no hairs. The nodule is asymmetrical, and its border is sharply demarcated; the color is uniform, and the elevation is regular. There is a narrow (1-2 mm) rim of erythema around most of the nodule. She has a sprinkling (about 25-30 in all) of melanocytic nevi on her trunk and legs. There is no significant local or distal lymphadenopathy. The liver is not palpable. The remainder of the physical examination is unremarkable.What is the most likely diagnosis? Given the equation 4square root of x minus 3 = -12, solve for x and identify if it is an extraneous solution.A. x = 0, solution is extraneousB. x = 0, solution is not extraneousC. x = 12, solution is extraneousD. x = 12, solution is not extraneous Which expression is equivalent to 10k + 17 - 7j - 18 - 11k?-8jk - 1-7j - k - 1-7j + k + 1-8j - kPLEASE HURRY !!!!20 POINTS!!! A gesture drawing is a Answer this fast and correct and you will get a thanks, a brainliest and a 5-star review along with 10 points! The exponent on b when b^3 is multiplied by b^3 isA. 3B. 6C. 9 Hi Everyone hope u all r doin well Pls Answer What happens when dilute sulphuric acid is poured on a copper plate ? Indicate the equation of the given line in standard form, writing the answer in the equation box below.The line containing the longer diagonal of a quadrilateral whose vertices are A(2, 2), B(-2,-2), C(1, -1), and D16, 4). The buffalo was the primary source of food shelter clothing and tools for native Americans of the A balloon is filled with 80 liters of gas on a day where the temperature was 34 degrees at sea level which is 101.3 kPa and released. As the balloon rises to a certain altitude, the temperature drops to 0 degrees celsius and the balloon doubles in volume. What is the atmospheric pressure at that altitude? A crucible (container) of molten metal has an open top with an area of 5.000 m^2. The molten metal acts as a blackbody radiator. The intensity spectrum of its radiation peaks at a wavelength of 320 nm. What is the temperature of that blackbody? Find the distance between the pair of points: (0,-8)and (0,4) Which action is not a risk for transmitting HIV?having an*l intercoursesharing syringes for injecting drugsbottle-feedingsharing tattoo needles One of the biggest challenges that we all face, at least inmy opinion it's a challenge, is making difficult decisions,life-altering decisions. These decisions are not onlydifficult to make, but they can also bring consequencesthat are not easy to live with. However, if decisions are wellthought out and carefully considered they will be easier tomake and easier to live with.What feedback would be most helpful feedback to give the writer of thisparagraph?O A. Make the claim more personal.B. Address a counterclaim.O C. Revise the claim to make it clearer.D. Improve the spelling and grammar. President Wilsons Moral Diplomacy led him to support Your English teacher asks you to write a story. You have to start with the story: I had a natural occurrence when I turned on the television. A psychologist is interested in determining whether a new online pain management program improves (reduces) pain scores for its participants. A group of pain patients are randomly assigned to participate in either the online program or a control group. At the end of the study the researcher administered a widely used pain level scale ranging from 1-10. What is the null hypothesis for the study? a sphere of mass 5kg and volume 210-5completely immersed in water find the buoyant force exerted water