PYTHON Comments MCQ
Python MCQ(1) How much space occupied after compilation of python script by comments?
A) 1 Byte
B) 1 KB
C) 1 MB
D) Zero Byte
Explanation
Comments does not occupy bytes in final code of python.
(2) In python script where we can write comment line?
A) Start of code
B) End of code
C) In between
D) Anywhere
Explanation
Comments can be placed anywhere in the entire script.
(3) Which of the following is use of comments in python?
A) Readability
B) Descriptive
C) Program Information
D) All of these
Explanation
Comments provide any easy way to describe elements/identifiers used in program.
(4) Which of the following is valid comment line in python?
A) #This is comment line
B) $This is comment line
C) //This is comment line
D) @This is comment line
Explanation
All preceding characters are part of comment after # symbol.
(5) How many types of comments in python programming langauge?
A) One
B) Two
C) Three
D) Four
Explanation
In python only single line comment syntax is available.
(6) In python programming which of following symbol is used for writing comments?
A) //
B) /
C) $
D) #
Explanation
Hash symbol indicate start of comment line in python language.
(7) Non executable statements in python are called.
A) Directives
B) Functions
C) Comments
D) Control Structures
Explanation
Comments are the lines of code which are not executed. These are start with #.