For and While loops in python

Veröffentlicht am: 04 Oktober 2025
auf dem Kanal: 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


Auf dieser Seite können Sie das Online-Video For and While loops in python mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Logic Class for Geeks 04 Oktober 2025 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 34 Mal angesehen und es wurde von 5 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!