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

Parser broken? #41

Closed
martin-henz opened this issue Apr 24, 2024 · 0 comments · Fixed by #43
Closed

Parser broken? #41

martin-henz opened this issue Apr 24, 2024 · 0 comments · Fixed by #43
Labels
bug Something isn't working

Comments

@martin-henz
Copy link
Member

https://share.sourceacademy.org/kojls

def fact_iter(product, counter, max_count):
    if counter > max_count:
        return product
    else:
        return fact_iter(counter * product,counter + 1, max_count)

def factorial_iterative(n):
    return fact_iter(1, 1, n)

factorial_iterative(5)

gives:

Line 14: ExpectedTokenError: SyntaxError at line 14 column 9
                   
def factorial_iterative(n):
         ^ Expected indent. Found 'return'.
@martin-henz martin-henz added the bug Something isn't working label Apr 24, 2024
@JJtan2002 JJtan2002 linked a pull request May 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant