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
In both the course and the reference sheet for Python101, the range function is presented as a function which takes only 2 parameters. To enforce this, it would be a nice enhancement to raise a warning when range is used with 1 (maybe) or 3 (surely) parameters.
It would be particularly useful for cases where one has to iterate in the reverse order: although L[::-1] is accepted for a list, and s[::-1] for a string, I don't believe the following example is considered acceptable in Python101:
def test():
"""->NoneType"""
#i:int
for i in range(10,0,-1):
print(i)
return None
And it is commonly used by people who know some Python (or search for examples online).
In case I'm incorrect, it's probably the course and reference sheets that would need to be updated to let everyone know that it is acceptable in Python101.
The text was updated successfully, but these errors were encountered:
In both the course and the reference sheet for Python101, the range function is presented as a function which takes only 2 parameters. To enforce this, it would be a nice enhancement to raise a warning when range is used with 1 (maybe) or 3 (surely) parameters.
It would be particularly useful for cases where one has to iterate in the reverse order: although L[::-1] is accepted for a list, and s[::-1] for a string, I don't believe the following example is considered acceptable in Python101:
And it is commonly used by people who know some Python (or search for examples online).
In case I'm incorrect, it's probably the course and reference sheets that would need to be updated to let everyone know that it is acceptable in Python101.
The text was updated successfully, but these errors were encountered: