Computer Science, asked by mintubajwa222, 1 month ago

how do u start writing a for loop in python

Answers

Answered by senseofscience
0

Answer:

for (counter variable) in range (no of times you want to execute the loop):

   #what to do inside the loop

Explanation:

this is the basic syntax of for loop

make a counter variable example i and it will keep track of how much times your loop had run

you can replace range function with a list or string and can define what you have to do with each item

finally if you want to use range function define the number of times the loop should run and write in indented blocks of program what you have to do each time when the loop runs

I HOPE MY ANSWER HELPS YOU

Similar questions