+ 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

26th Apr 2019, 12:03 AM
Geovanny Martínez Forero
Geovanny Martínez Forero - avatar
12 odpowiedzi
+ 27
⚡Prometheus ⚡ Definitely, it is a bug. I also did tests. Thanks a lot..! I hope SoloLearn Team take note about this.
26th Apr 2019, 3:59 AM
Geovanny Martínez Forero
Geovanny Martínez Forero - avatar
+ 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
26th Apr 2019, 1:22 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 20
Kristi Teneqexhi Don't worry about it. It is a bug that SoloLearn Team will fix sooner or later.
27th Apr 2019, 12:38 AM
Geovanny Martínez Forero
Geovanny Martínez Forero - avatar
+ 19
Sonic Thanks for the suggestion. It's done...!
27th Apr 2019, 12:37 AM
Geovanny Martínez Forero
Geovanny Martínez Forero - avatar
+ 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
26th Apr 2019, 1:27 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 10
Geovanny Martínez Forero email Sololearn about the bug. You have a valid reason for them to fix it.
26th Apr 2019, 11:58 AM
Sonic
Sonic - avatar
27th Apr 2019, 11:55 AM
Kristi Teneqexhi
Kristi Teneqexhi - avatar
26th Apr 2019, 10:05 PM
Kristi Teneqexhi
Kristi Teneqexhi - avatar
+ 2
You can just submit and itll work https://code.sololearn.com/c0yYao1x0Ek2/?ref=app
26th Apr 2019, 10:09 PM
Kristi Teneqexhi
Kristi Teneqexhi - avatar
+ 1
It seems to be done thanks
28th Apr 2019, 8:49 AM
Sonu
0
i still don’t get it some one pls help me
7th May 2019, 2:38 PM
Budharaju Aakanksha
Budharaju Aakanksha - avatar
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
31st Dec 2020, 2:25 PM
Wah Wah Shwe(와와쵀)
Wah Wah Shwe(와와쵀) - avatar