Python for loop | python range() function | python nested for loop | CBSE | for loop with examples

Опубликовано: 20 Март 2026
на канале: SA Educational Hub
106
1

In this Python tutorial for beginners, we will learn for loop in python. This Python tutorial video covers: syntax of for loop in python, examples of for loop in python, nested for loop with example, python range() function with examples and important points for range function.
We have also discussed range function with a single parameter, range function with two parameters and range function with three parameters.
What is for loop?
The for loop in Python is used to process the items of a sequence, such as a list, a tuple, a string, a dictionary, or a set.
A for loop repeats its loop body for each element of the sequence, in order. When it reaches the end of the sequence, the loop ends.
Syntax:
for variable in sequence :
statement(s)
The general form of the for loop is:
• The for keyword
• A variable name
• The in keyword
• A sequence (that is either a list, a string, a tuple, dictionary, or a set.).
• A colon
• Starting on the next line, an indented block of code (called the for clause or body of the for loop )
The range function:
The range() function returns a sequence of numbers.
Syntax :
range(start, stop, step)
start : An integer number indicating the starting point. By default, it is 0. This parameter is optional.
stop : An integer number indicating the stopping point. But not including the number you gave it.
step : An integer number to specify the increment value. By default, it is 1. This parameter is optional.
Nested loop:
A loop may contain another loop in its body. This form of loop is called a nested loop.
The inner loop of a nested loop must terminate before the outer loop.
For each iteration of the "outer loop," the "inner loop" will be executed once.
Important points for range():
The step value must not be zero. If step parameter is zero, ValueError is raised.
The arguments to the range() function must be integers. We cannot use floating-point or non-integer numbers in any of its arguments.


This video is for CBSE students.
This video is for engineering students.
This video is for anyone (BCA, MCA, BTECH, BSc, MSc, PGDCA, Diploma and computer engineering students, under graduate or post graduate computer science students) who is interested in learning Python programming.
This is the best Python tutorial on YouTube.
Our video series is a Python tutorial for beginners.This video series will guide you through how to learn Python from scratch. 
I am Ambika, having 20 years of teaching experience. My mentor, friend, and guide, Situn (Anand), is a genius with an excellent academic record and is currently working on machine learning.
Please like, share and subscribe to our channel.
Thank you.
With love,
SA Educational Hub

Link to Data types in Python:
   • Data Types in Python | Numeric | String | ...  
Literals in Python:
   • Literals in Python | String Literals | Num...  
Links to other videos:
Channel :
   / @saeducationalhub5697  

Indentation in Python
   • Indentation in Python | Python Indentation...  
Errors in Python
   • Errors in Python | Syntax Errors | Logical...  
Accepting input from user
   • Accepting input from the console in Python...  
Type conversion:
   • Type conversion in Python | Implicit and E...  

Data types in Python:
   • Data Types in Python | Numeric | String | ...  
Operator precedence:
   • Operator Precedence in Python | Associativ...  
Evaluation of expression:
   • Evaluation of Expressions in Python | CBSE...  
Mutable and immutable:
   • Mutable and Immutable in Python | differen...  
String data type
   • String data type in Python | String in Pyt...  
List data type in Python:
   • List data type in Python | List | List in ...  
Tuple data type in Python:
   • Tuple data type in Python | Tuple | Tuple ...  
Dictionary data type:
   • Dictionary data type in Python | Dictionar...  
Boolean data type
   • Boolean data type in Python | Boolean Type...  
Comments
   • Python Comments | Comments in Python | CBS...  
Rvalue and Lvalue
   • Lvalue and Rvalue | Lvalue and Rvalue in P...  
Python variable
   • Python Variables | Variables in Python | C...  
Identity operators in Python
   • Identity operators in python | is operator...  
Operators in python
   • Operators in Python | Arithmetic | Compari...  
Literals in Python:
   • Literals in Python | String Literals | Num...  
Introduction To Python:
   • Introduction To Python | what is python | ...  
Features of Python
   • Features of Python | Python Tutorial for B...  
Install python on Android
   • How To Install Python On Android|Python fo...  
Compiler Vs Interpreter
   • compiler vs interpreter | difference betwe...  
Hello World in python:
   • Hello World in python | Interactive mode a...  
Print Vs sys.stdout.write
   • print vs sys.stdout.write in python | diff...  
What does print return
   • What does print () return in python | retu...  
Character set in Python
   • Python Character Set | Python Tokens| Unic...  
Identifier
   • Identifiers in Python | Python Tutorial | ...  
Keywords
   • Keywords in Python | Python Tutorial | Pyt...  
What does print return
   • What does print () return in python | retu...  
What is a data type in Python
   • What is a data type in Python | Different ...  

#pythontutorial
#python
#cbse
#cbseclass11
#cbseclass12
#cbsepython
#pythonprogramming
#learnpython
#pythontutorialforbeginners
#pythonlanguage