Comments

Comments are very important in your programs. They are used to tell you what something does in English, and they also are used to disable parts of your program if you need to remove them temporarily. Here’s how you use comments in Python:

# Single-line comment.
# This will be ignored by Python

"""
Tripple-quotes enclose a multi-line comment.
Sometimes, if you have a lot to explain,
the multi-line comment can look nicer
than a bunch of single-line comments.

Everything within the tripple-quotes will
be ignored as well.
"""

Your Task

Create a file called:

comments.py

Given the Python code below, comment out certain lines and un-comment certain lines to get the output shown. Don’t delete any lines, just comment them out.

You may copy and paste this code rather than manually typing it.

The Code

print("(▀̿Ĺ̯▀̿ ̿)")
# print(1)
print(2)
print("\ (•◡•) /")
print(3)
print(4)
print("( ͡° ͜ʖ ͡°)")
# print(5)
# print(6)
# print(7)
print("¯\_(ツ)_/¯")
print(8)
print(9)
# print(10)

The Desired Output

1
2
3
4
5
6
7
8
9
10

© 2021 Daniel Gallo

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.

Creative Commons License

Adapted for Python from Graham Mitchell’s Programming By Doing