Quiz Discussion

What will be the output of the following Python code snippet if x=1?

x<<2

 

Course Name: Python

  • 1]

    4

  • 2]

    2

  • 3]

    1

  • 4]

    8

Solution
No Solution Present Yet

Top 5 Similar Quiz - Based On AI&ML

Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api

# Quiz
1
Discuss

Which among the following list of operators has the highest precedence?

 +, -, **, %, /, <<, >>, |

 

  • 1]

    %

  • 2]

    |

  • 3]

    **

  • 4]

    <<, >>

Solution
2
Discuss

Which of the following represents the bitwise XOR operator?

  • 1]

    !

  • 2]

    |

  • 3]

    ^

  • 4]

    &

Solution
3
Discuss

What will be the value of X in the following Python expression?

X = 2+9*((3*12)-8)/10

 

  • 1]

    27.2

  • 2]

    28.4

  • 3]

    30.8

  • 4]

    30.0

Solution
4
Discuss

What will be the output of the following Python code snippet?

not(3>4)
not(1&1)

 

  • 1]
    True
    True
  • 2]
    True
    False
  • 3]
    False
    True
  • 4]
    False
    False
Solution
5
Discuss

What will be the output of the following Python expression?

0x35 | 0x75

 

  • 1]

    118

  • 2]

    117

  • 3]

    119

  • 4]

    116

Solution
6
Discuss

What will be the output of the following Python code snippet?

['hello', 'morning'][bool('')]

 

  • 1]

    morning

  • 2]

    hello

  • 3]

    no output

  • 4]

    error

Solution
7
Discuss

What will be the output of the following Python code if a=10 and b =20?

a=10
b=20
a=a^b
b=a^b
a=a^b
print(a,b)

 

  • 1]

    20 20

  • 2]

    20 10

  • 3]

    10 10

  • 4]

    10 20

Solution
8
Discuss

Bitwise _________ gives 1 if either of the bits is 1 and 0 when both of the bits are 1.

  • 1]

    OR

  • 2]

    AND

  • 3]

    XOR

  • 4]

    NOT

Solution
9
Discuss

What will be the value of the following Python expression?

 bin(10-2)+bin(12^4)

 

  • 1]

    0b10000b1000

  • 2]

    0b1000b1000

  • 3]

    0b10001000

  • 4]

    0b10000

Solution
10
Discuss

What will be the output of the following Python expression?

print(4.00/(2.0+2.0))

 

  • 1]

    1

  • 2]

    1.00

  • 3]

    1.0

  • 4]

    Error

Solution
# Quiz