Python Comment | Sololearn: Learn to code for FREE!

+2

Python Comment

""" input() """ Why this comment is executing on code playground of Sololearn Tell me its reason & if it's a bug plz fix it M facing problems in my program

5/10/2020 10:54:29 AM

Prince Kumar

13 Answers

New Answer

+4

+2

No bug

+2

Thats just a an input call in between two empty docstrings

+2

See comments: https://code.sololearn.com/c6Gt7n8O49F5/?ref=app edit: πŠπ’π’π›π¨ π†π‘πšπ²πšπ₯ https://code.sololearn.com/cz0iIkaidH41/?ref=app

+1

Slick but it's multiline comment & Comments are not executed

+1

Multiline comment is ''' Your comment ''' with only 3 good sir

+1

Slick ''' input() ''' But it's also executing ,why?

+1

Just tried it. Now THATS a bug. Nice find. But the first example will always execute the input statement

+1

Slick 2nd too

+1

On sololearn. Not in other coding environments. 2nd is the proper format of a multiline comment or docstring and input() will not execute

+1

Slick yeah

+1

Daljeet Singh thanks

+1

It's a bug. SoloLearn's Compilers forcefully checks all code, technically an input function will still get compiled even if it is inside a comment.