Search code examples
pythoncomments

Why does a set of double quote comment have effect on real code


This is the code which be reported error unexpexted indentation(because of the comment YOUR CODE HERE double quoted)

    while score0 < goal and score1 < goal:
        if  who == 0:
            num_rolls = strategy0(score0, score1)
            score0 += take_turn(num_rolls, score1, dice)
            who = other(who) if extra_turn(score0, score1) == False else who
        else:
            num_rolls = strategy1(score1, score0)
            score1 += take_turn(num_rolls, score0, dice)
            who = other(who) if extra_turn(score1, score0) == False else who    
    "*** YOUR CODE HERE ***"    

when I delete the "*** YOUR CODE HERE ***" (same indentation level of while) ,everything works fine.

By the way ,I have never seen a comment with a set of double quote(" ").Maybe common format of comment is like """ """ or #

Answer: the "*** YOUR CODE HERE ***" is a string literal.


Solution

  • That isn't a comment, it's a string literal