Python Programming Training Certification
Flexible Hours
100 Assignments
Instructor Led online Training
50 LMS Access
24X7 Support
100% Skill Level
Enquire Now
Course Overview
Python range() Function
Python range() function returns an immutable sequence of numbers starting from 0, increments by 1 and ends at a specified number.
Signature
- range(start, stop, step)
Parameters
start (optional) : It is an integer number that specifies the starting position. The Default value is 0.
stop (optional) : It is an integer that specifies the ending position.
step (optional) : It is an integer that specifies the increment of a number. The Default value is 1.
Return
It returns an immutable sequence of numbers starting from 0, increments by 1, and ends at a specified number.
Python range() Function Example 1
The below example shows the working of range().
-
# empty range
print(list(range(0)))# using the range(stop)
print(list(range(4)))# using the range(start, stop)
print(list(range(1,7 )))
Output:
- []
[0, 1, 2, 3]
[1, 2, 3, 4, 5, 6]
Explanation:
Note: In the above example, we’ve converted the range to a Python list and returned a generator-like object that only prints the output on demand.
A range object returned by the range constructor can also be accessed by its index. It can support both positive and negative indices.
Python range() Function Example 2
The below example creates a list of number between the given numbers using range() function.
-
start = 5
stop = 12
step = 4print(list(range(start, stop, step)))
Output:
- [5, 9]
Candidate’s Journey During Our Training Program
Expert’s Advice & Selection of Module
Choosing the right type of module for the training is half the battle & Our Team of experts will help & guide you.
Get Trained
Get Trained & Learn End to End Implementation from our Expert Trainer who are working on the same domain.
Work on Projects
We Do make our student’s work on multiple case studies , scenario based tasks & projects in order to provide real-time exposure to them.
Placements
We have a dedicated placement cell in order to provide placement assistance & relevant interviews to our candididates till selection
Placement Partner