Question: In Python, what is the primary purpose of a for loop? A . To define a new variable. B . To create a list of
In Python, what is the primary purpose of a "for" loop?
A To define a new variable.
B To create a list of elements.
C To check if two values are equal.
D To iterate over a sequence eg a string or range and perform a set of actions for each element.
E To repeatedly execute a block of code as long as a specified condition is true.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
