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
What colorful format should you use to bring attention to an important sentence or phrase
lidiya [134]

Answer:

Highlight

Explanation:

6 0
3 years ago
3. Create mode was one of the most innovative and influential features of which of the following games?
melamori03 [73]
FarmVille would be the correct answer because it is a game where you build a create your own farm without nobody telling you to this or that
8 0
3 years ago
What is an example of constructive criticism for an employee who is shy during meetings?
rewona [7]
<span>Speak up more so people don't think you're rude</span>
8 0
3 years ago
Read 2 more answers
What is your personal definition of life? How do you appreciate life?​
kompoz [17]
The definition of life is to fulfill your purpose.To accomplish your goals and enjoy life.Appreciate the little things that happen in your life and look out for others and love unconditionally.Have a positive attitude in life.Love Yourself!
3 0
2 years ago
Specialized high-capacity second storage devices designed to meet organizational demands
zzz [600]

Answer:

CD devices

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • A computer’s memory is composed of 8K words of 32 bits each. How many bits are required for memory addressing if the smallest ad
    10·1 answer
  • How would Microsoft Word inform you of the error in the sentence below? (Tip: The error is in bold.)
    7·1 answer
  • Is a network where connected devices are located within the same building.
    5·2 answers
  • ? Question
    6·2 answers
  • Write a Unix (Linux) find-like command (myFind) in Python3 where the function will return the full paths of all the files contai
    9·1 answer
  • What happens to a data table when the formulas or variables used to create it are changed?
    9·2 answers
  • Can find error , suppose to print what season it is and if fails : Traceback (most recent call last):
    11·1 answer
  • System. Construct an ER diagram for keeping records for exam section of a college.​
    10·1 answer
  • Instructions
    8·1 answer
  • A parent process calling _____ system call will be suspended until children processes terminate.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!