For and While loops in python

Pubblicato il: 04 ottobre 2025
sul canale di: Logic Class for Geeks
34
5

For and While loops in python.

#Print 1 to 5
for i in range(1,6):
print(i)

#benefits of loops:
#1. Reduces lines of code
#2. Code becomes easier to understand


#Syntax of Python range() function
#Syntax: range(start, stop, step)

#start: [ optional ] start value of the sequence
#stop: next value after the end value of the sequence
#step: [ optional ] integer value, next step value of the sequence



#print all even numbers from 1 to 100
for i in range(1,101):
if(i%2==0):
print(i ,end=" ")
else:
continue

What are loops in python ?
What is for loops ?
What is while loops?
How for loops work?
How while loops work?
What is range in python?
How range function works in python?

#coding #helloworld #logicclassforgeeks #programming #codingclass #learncoding #programminglanguage #basic #computerknowledge #firstcodingclass #loops #forloop #while #whileloop


In questa pagina del sito puoi guardare il video online For and While loops in python della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Logic Class for Geeks 04 ottobre 2025, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 34 volte e gli è piaciuto 5 spettatori. Buona visione!