 1. What is the output of the following code?
x, y, z = 100, 200 ,300
print(x, y, z)
 2. Which operator has higher precedence in the following list?
a. % (Modulus)
b. & (BitWise AND)
c. ** (Exponent)
d. > (Comparison)
 3. What is the output of the following code?
 var1 = 1
 var2 = 2
 var3 = "3"
 print(var1 + var2 + var3)
 4. What is the output of the following code?
valueOne = 5 ** 2
valueTwo = 5 ** 3
print(valueOne)
print(valueTwo)
 What is the output of the following code?
 16//3
 a) 5.0
 b) 5
 c) 1
 d) None of These
The symbol used for commenting a line in pyhton is:
a) $
b) &
c) #
d) @
 Which python operator means 'less than or equal to’?
 a. >=
 b) >
 c) <
 d) <=
 What is the value of the expression 100 / 25?
 a) 0.4
 b) 4
 c) ”4”
 d) ‘4’
 a = 100
 b = 200
 What is the value of the expression ‘a and b’?
 a) False
 b) True
 c) 100
 d) 200
 Which operator symbol is used by Python to assign values to variables?
 a) #
 b) =
 c)==
 d) $
 1. 100 200 300
 2. c (**)
 3.Error (unsupported operand type(s) for +: 'int' and 'str’)
 4. 25
125
5.

PYTHON QUIZ - 1.pptx

  • 2.
     1. Whatis the output of the following code? x, y, z = 100, 200 ,300 print(x, y, z)
  • 3.
     2. Whichoperator has higher precedence in the following list? a. % (Modulus) b. & (BitWise AND) c. ** (Exponent) d. > (Comparison)
  • 4.
     3. Whatis the output of the following code?  var1 = 1  var2 = 2  var3 = "3"  print(var1 + var2 + var3)
  • 5.
     4. Whatis the output of the following code? valueOne = 5 ** 2 valueTwo = 5 ** 3 print(valueOne) print(valueTwo)
  • 6.
     What isthe output of the following code?  16//3  a) 5.0  b) 5  c) 1  d) None of These
  • 7.
    The symbol usedfor commenting a line in pyhton is: a) $ b) & c) # d) @
  • 8.
     Which pythonoperator means 'less than or equal to’?  a. >=  b) >  c) <  d) <=
  • 9.
     What isthe value of the expression 100 / 25?  a) 0.4  b) 4  c) ”4”  d) ‘4’
  • 10.
     a =100  b = 200  What is the value of the expression ‘a and b’?  a) False  b) True  c) 100  d) 200
  • 11.
     Which operatorsymbol is used by Python to assign values to variables?  a) #  b) =  c)==  d) $
  • 12.
     1. 100200 300  2. c (**)  3.Error (unsupported operand type(s) for +: 'int' and 'str’)  4. 25 125 5.