Page 193 - Ai Book - 10
P. 193
Example :
Comments
Comments refer to the statements that are added to a program with the purpose of making the code easier
to understand. These statements are ignored by compilers and interpreters. There are two types of comments
in Python.
u Single line comment
u Multi-line comment
Single-Line Comment
In Python, we use # special character to start the comment. In Python, symbol # is used to start a comment.
Whatever is written after this symbol will be not printed on the screen.
# This is just a comment. Anything written here is ignored by Python compiler.
Example:
Multi-line Comment
To have a multi-line comment in Python, we use triple single quotes at the beginning and at the end of the
comment. This sytax is:
‘‘‘This is a
multi-line
3-line comment’’’
Example:
Keywords
Keywords are the reserve words in programming language that convey a special meaning to the language
compiler/interpreter. These words must not be used as normal variable names. Some reserved words for Python
programming language are as follows:
none false elif else
true as continue return
and global break try
finally def import or
67
67