identifiers and variables

Using Comments


In Python, comments begin with hash symbol (#). The lines that begins with # are considered as comments and ignored by the Python interpreter. Comments may be single line or no multi-lines. The multiline comments should be enclosed within a set of # as given below.

# It is Single line Comment

# It is multiline comment

which contains more than one line #

Qus. 1 : Which symbol is used to write single line comment ?

  1. .
  2. #
  3. /
  4. ?
Qus. 2 : <p>What will be the output of the following Python code?</p><pre><span style="font-size: 12.6px;">def power(x, y=2): r=1 for i in range(y): r=r*x return r print(power(3)) print(power(3,3))</span><br></pre><div><span style="font-size: 14px;">(A)&nbsp; <span style="white-space:pre"> </span>212</span></div><div><span style="font-size: 14px;">&nbsp; &nbsp; &nbsp; <span style="white-space:pre"> </span>32</span></div><div><span style="font-size: 14px;">(B) <span style="white-space:pre"> </span>9</span></div><div><span style="font-size: 14px;">&nbsp; &nbsp; &nbsp;<span style="white-space:pre"> </span>27</span></div><div><span style="font-size: 14px;">(C) <span style="white-space:pre"> </span>567</span></div><div><span style="font-size: 14px;">&nbsp; &nbsp; &nbsp;<span style="white-space:pre"> </span>98</span></div><div><span style="font-size: 14px;">(D) None of the above</span></div>

  1. Option A
  2. Option B
  3. Option C
  4. Option D
Qus. 3 : ______ are additional readable information to clarify the statement in python.

  1. Comments
  2. Expressions
  3. Tokens
  4. Flow of control

Programs

python program to input a welcome message and print it

View Solution


python program to print number of seconds in year

View Solution


Python program to calculate GST Goods and Service Tax

View Solution


python program to find the ASCII Value of entered character

View Solution


python program that display a joke but display the punch line only when the user presses enter key

View Solution


python program to generate the following output 5 10 9

View Solution


python program to print 5@10@9

View Solution


Latest Current Affairs 2024 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad