As you begin to write longer and longer programs, it’s often helpful to write
notes in your code. These are called comments. A comment is meant to be a short
note explaining a section of code to the programmer, and is ignored by the
computer. There are two types of comments.
"""This program takes two numbers from the userand then outputs the sum."""x=float(input("Enter a number: "))y=float(input("Enter another number: "))print("The sum of your numbers is {}".format(x+y))
1.12. Comments#
As you begin to write longer and longer programs, it’s often helpful to write notes in your code. These are called comments. A comment is meant to be a short note explaining a section of code to the programmer, and is ignored by the computer. There are two types of comments.
# Single line comments
Here are some examples:
1.12.1. Single line comment#
1.12.2. Multi-line comments#