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
Inga [223]
3 years ago
9

(Python question)

Computers and Technology
2 answers:
Alborosie3 years ago
7 0

Yo sup??

A real life example for 'for loop' and a 'while loop' would be

imagine if I opened a new burger shop.

we plan to issue a 'Thank you' message to the first 2000 customers and a 'Never to see you again' for all.

So for doing the first part ie to issue a 'thank you' message I will use a for loop because I am aware of the number of iterations whereas for the latter part ie to issues the 'never to see you again' message I would use a while loop cause I am not aware about the customers that are gonna visit my shop.

Hope this helps

PS: in which language is brainly written??

Law Incorporation [45]3 years ago
3 0

Hey!

---------------------------------------------------

Definition:

A "for loop" is something used for repeating things over a list of items. For instance, a list or a dictionary.

Code:

colors = ["red", "green", "blue"]

for x in colors:

 print(x)

---------------------------------------------------

Definition:

A "while loop" is is something used for carrying out a set of lines that are true.

Code:

n = 1

while i < 4:

 print(n)

 n += 1

---------------------------------------------------

Real-Life Example:

A real-life example would if I was a manager or boss for a company say that everyone was off a certain day. Like, if I said everyone was off for Christmas the 25th. If I had 1000 employees that would take a very long time to send an email to everyone. Instead of sending an email to everyone I can program code that uses "for loops" and "while loops" to create a message and send it to everyone.

---------------------------------------------------

Hope This Helped! Good Luck!

You might be interested in
Which of the following does not make a good analysis class? (Points : 6) its name reflects its intent
satela [25.4K]

Answer:it has high coupling

Explanation: Coupling is the property in the field of computer program that is defined as the functions ,data and  codes of the program are dependent on each other and cannot be changed independently if requires. Thus,high amount of coupling is not considered as good factor due to high interdependence. Loose coupling can be still permitted.

Other options are correct because name of the class should reflect the purpose and well defined responsibilities should be present, modeling of certain component and high cohesion means keeping similar functions togather is also required. So, the only bad factor is high coupling

6 0
3 years ago
Tamika has received an average of 97% on all of her math tests, has done well on her homework assignments, and participates in c
sashaice [31]

Answer:

B is the correct answer.

6 0
2 years ago
Read 2 more answers
Namespaces cannot have namespaces as members.<br><br> True<br><br> False
Anna71 [15]

Answer:

False

Explanation:

namespaces can be nested. That is we can have a hierarchy of namespaces.

For examples suppose we have a namespace top. Within this we have another namespace first. At the next level we have a namespace called second. Then we have a class MyClass as a member of this namespace second. Then the complete description of the class will be as follows:

top::first::second::MyClass

5 0
3 years ago
What does the opacity effect do
coldgirl [10]

Opacity is the extent to which something blocks light. You can change the opacity of layers, filters, and effects so that more (or less) of the underlying image shows through.

6 0
3 years ago
Read 2 more answers
The typing area is bordered on the right side by bars in ms word
lidiya [134]

Answer:

Explanation:

PTA NHI

6 0
3 years ago
Other questions:
  • Which is true about POP3 and IMAP for incoming email?
    6·1 answer
  • a marketing company is setting up a new office in the city. which type of contract should they sign for periodic maintenance of
    15·1 answer
  • True/False/Unknown. For the interpretation of function calls, we assign the formal parametersto the valuations of the actual arg
    11·1 answer
  • Select the correct answer.
    12·1 answer
  • How can you represent a graphic element in a wireframe?
    5·1 answer
  • What is a special type of variable used in subroutines that refers to a piece of data?
    15·1 answer
  • Emma lives in Pennsylvania, what climate does she live in?
    7·1 answer
  • State the functions of all the parts of the computer​
    14·1 answer
  • Tennis players are not allowed to swear when they are playing in Wimbledon
    6·2 answers
  • Which of the following shows data conversion taking place?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!