+ 33
This simple multiline comment in Python requires input, why?
This afternoon, I was testing a code in SL PLayground using Python. I decided to add some final comments to my code. However, there was a strange behaviour adding a multiline one: "Seems like your program requires input" It took me some time to discover what the problem was. Finally, I noted that 'input' word, which is not a 'keyword' but a built-in function in Python, is causing the issue when there is a '(' later. This weird behaviour is reproduced running the snippet below! So, whyyyyy? https://code.sololearn.com/c6Gt7n8O49F5/?ref=app
12 ответов
+ 27
⚡Prometheus ⚡ Definitely, it is a bug. I also did tests. Thanks a lot..!
I hope SoloLearn Team take note about this.
+ 21
This is a bug in the Python interpreter of Sololearn.
When the interpreter parses the code it takes one look at "input()" and decides that your code needs input.
This does not occur if you just use input without paranthesis
+ 20
Kristi Teneqexhi Don't worry about it. It is a bug that SoloLearn Team will fix sooner or later.
+ 19
Sonic Thanks for the suggestion. It's done...!
+ 11
https://code.sololearn.com/cYAqGcC0C6A3/?ref=app
In this example, I replaced the function-type variable input with the print function-type variable.
Coding conventions is the only thing that stops you from doing this btw but I decided to explore.
Now if I try to use the input(), it should behave like a print() function, but it still asks me for input before doing what it should do.
This proves that the bug is in the parsing of Python code
+ 10
Geovanny Martínez Forero email Sololearn about the bug. You have a valid reason for them to fix it.
+ 4
Geovanny Martínez Forero oh ok
+ 2
look at this
https://code.sololearn.com/cAgzQZL2rEEO/?ref=app
+ 2
You can just submit and itll work
https://code.sololearn.com/c0yYao1x0Ek2/?ref=app
+ 1
It seems to be done thanks
0
i still don’t get it
some one pls help me
0
I test it like this! you're right. May be compiler does't know it's a comment.
https://code.sololearn.com/ca5a11a15a24/?ref=app