When should the while loop be used in Python? When a condition is not necessary for the action to repeat When the range of repetitions includes positive and negative numbers When an action will be repeated for a specific number of repetitions When the exact number of repetitions is unknown
am i right with C?
@vocaloid
you may be confusing for loops and while loops a *for* loop is better when you know exactly how many repetitions you need, but a *while* loop doesn't define a specific number of repetitions, but rather runs until the condition is false
so its either a or d
i think d is the best from what you explained..
yup, D is better A is contrary to the purpose of a loop in the first place (to set up an action that will occur only if a condition is met)
thank you
Join our real-time social learning platform and learn together with your friends!