Seudónimo Seudónimo
  • 20-11-2020
  • Computers and Technology
contestada

please help me!
When you know ahead of time how many passes you will make through a loop, a(n) ____(definite/indefinite) loop is best. Such a loop uses ____. (while/for)

Respuesta :

vfxdead
vfxdead vfxdead
  • 20-11-2020

Answer:

Choose what you think based on this.

Explanation:

with a for loop:

>>> students = 3

>>> for student in range(students):

>>> print(student)

would output

>>> 0

>>> 1

>>> 2

with a while loop now:

>>> students = 3

>>> student = 0

>>> while student < students:

>>> student = student + 1

>>> print(student)

the for loop is more compact than the while loop. But there may be some times when a you cant do a for loop. The first question is more than likely definite but I don't know the second answer.

Answer Link

Otras preguntas

The two factors that cause technology to progress
Which is a likely result of taking LSD a. raised heart rate and sped-ip nervous system b. altered mood and sensory perceptions c. reduced heart rate and loss
how many times does 116 goes into 30
5/4+x=3/4 how do I figure this out
What did the colonists send to Britain as their last effort for peace in July 1775
An Athenian education focused on preparation for
good chemistry question
Which of the following is NOT essential for individuals to have to build their own web page? a. ISP b. web host c. domain name d. Linux
In which of the following scenarios would the WTO be criticized? a. Less-expensive goods promote consumer well-being. b. BMW of Germany can sell its cars in t
Complete the sentence with the correct form of the verb gustar and the indirect object pronoun (me, te, le, etc). A nosotros no __________ __________ mirar