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 (e.g., 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!