You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect Comment About range Function in python-for-beginners/12 - Loops/number.py #88
The comments in the python-for-beginners/12 - Loops/number.py file contain inaccuracies about the range function in Python.
Details:
In the file number.py, the comment states:
# range creates an array# First parameter is the starter# Second indicates the number of numbers to create# range(0, 2) creates [0, 1]
This is incorrect because:
range does not create an array; it creates a range object.
The second parameter of range specifies the end value (exclusive), not the number of values to create.
range(0, 2) does indeed create [0, 1], but the comment should clarify that the second parameter is the end value, not the count of numbers.
Suggested Correction:
Update the comments in number.py to accurately describe the range function. For example:
# range creates a range object, not an array# The first parameter is the starting value# The second parameter is the ending value (not included in the sequence)# range(0, 2) creates a sequence [0, 1]
Activity
saiyoji commentedon Aug 9, 2024
zjrsss commentedon Aug 9, 2024
Hassan9255 commentedon Jul 29, 2025
can i contribute?