-
Notifications
You must be signed in to change notification settings - Fork 11
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
Days to Target function IndentationError #103
Comments
On diffchecker.com, there is an extra (invisible) tab-width character in the code from above which is absent in the code below (which was later submitted, and passed the tests).
In this image, the code on the left is the code that gave the error, and the code on the right is the code that passed. |
When I convert the original code from unicode to UTF-16, the character shows up as |
I'm guessing it doesn't like the mix of spaces and tabs which is causing the indentation error. If I run the code with either all spaces or all tabs it is fine. But as soon as I mix the two it throws an indentation error. Hopefully there is a setting in CodeMirror to convert tabs to spaces or something similar. EDIT: There is no default setting but we can try override the default tab key functionality in the CodeMirror config, see https://stackoverflow.com/questions/15183494/codemirror-tabs-to-spaces I'll test it out to see if it works. |
A warning sounds like a good idea. It could contribute as a small teaching moment, i.e. you can't use both spaces and tabs, and it doesn't require us to fix their code for them. |
The code below was submitted as an answer to the
Days to Target
function question.When the code is run locally (I ran it in Wing), the function runs without an error being thrown and all of the test cases pass, but when it is run in codeWOF, I get the following error:
I have not been able to figure out why the behaviour is different when the same function is run in these two different environments.
The text was updated successfully, but these errors were encountered: