Dec-22-2019, 01:35 AM
Dec-22-2019, 01:51 AM
It's going to depend on what editor you are using, it's not a Python thing.
One thing that is a Python thing is triple quotes. A string that starts and ends with three quotes is a multi-line string, and is treated as a special kind of comment. So this:
One thing that is a Python thing is triple quotes. A string that starts and ends with three quotes is a multi-line string, and is treated as a special kind of comment. So this:
for knight in camelot: # knight.sing() # knight.dance() # knight.do_routines() knight.footwork(impeccable = True) print("It's only a model.")Is equivalent to:
for knight in camelot: """knight.sing() knight.dance() knight.do_routines()""" knight.footwork(impeccable = True) print("It's only a model.")So it's an easy way to comment out multiple lines.