indentation - Python: Comment out a block heading without dedenting all the code inside -
Sometimes I need to temporarily comment on block headings for testing purpose, for example:
i = 2 s = {'a', 'b', 'c'} # timing i & gt; 0: s.pop () i - = 1 print (s) But since the Python is part of the syntax, if I run the code above: s.pop () ^ indentation error: unexpected indent I know that while dedenting inside code coded it will work , But I is there any trick to accomplish this?
what about it if true: as an alternative? Then just exchange between the '#' between while and if to get your desired effect.
Comments
Post a Comment