Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

range function accepted with 3 parameters #110

Open
fbouchet opened this issue Dec 9, 2019 · 1 comment
Open

range function accepted with 3 parameters #110

fbouchet opened this issue Dec 9, 2019 · 1 comment
Labels

Comments

@fbouchet
Copy link

fbouchet commented Dec 9, 2019

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.

@fredokun
Copy link
Collaborator

I need to check what is supported now, and take a decision from that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants