Quiz: Operators and Expression

To View Tricks: Login Required

Number of Questions: 12

Question: 11 -

What is the output of the following Python code

x = 10
y = 50
if x ** 2 > 100 and y < 100:
    print(x, y)

Options:
  1. 10 50

  2. None of these

  3. 100 500

  4. Error

  5. Answer:

    None of these

    Solution not available.

Question: 12 -

What is the output of the following code

x = 6
y = 2
print(x ** y)
print(x // y)

Options:
  1. 66
    0

  2. 36
    0

  3. 66
    3

  4. 36
    3

  5. Answer:

    36
    3

    Solution:

    • The Exponent (**) operator performs exponential (power) calculation. so here 6 ** 2 means 6*6 = 36
    • The // is the Floor Division operator