# this is a single line commentx = 5#ans: another commenty = 10
# comment after codex = 5 # inline commentname = "Alice" # another inline
"""This is amulti-line commentor docstring"""x = 5
'''This is alsoa multi-line comment'''y = 10
# x = 10x = 5#ans: x is 5 (commented line ignored)
# what is x?#ans: x = 10x = 5#ans: 5# what gets executed?x = 5 # x = 10#ans: x is 5
# multiline comment?"""x = 10"""x = 5#ans: x is 5
# can you do this?x = 5 """comment"""#ans: SyntaxError# what about this?x = 5 # commenty = x#ans: y is 5
# nested comments?#ans: # this is a comment#ans: valid, just a comment# multiline string as comment?'''This is alsoa comment'''#ans: valid if not assigned to anything
# what is x?x = 5#ans: x = 10#ans: x is 5# inline multiline?x = 5 """ this won't work """#ans: SyntaxError
# comment with backslash?x = 5 # this is \#ans: a comment#ans: two separate single-line comments
# doc string vs comment?def func(): """This is docstring""" # This is comment pass#ans: both valid, different purposes
Google tag (gtag.js)