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
On this page of the site you can watch the video online For and While loops in python with a duration of hours minute second in good quality, which was uploaded by the user Logic Class for Geeks 04 October 2025, share the link with friends and acquaintances, this video has already been watched 34 times on youtube and it was liked by 5 viewers. Enjoy your viewing!