Quiz Discussion

What will be the output of the following Python expression?

bin(29)

 

Course Name: Python

  • 1]

    ‘0b11011’

  • 2]

    ‘0b11111’

  • 3]

    ‘0b11101’

  • 4]

    ‘0b10111’

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

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
2
Discuss

Which of the following Boolean expressions is not logically equivalent to the other three?

  • 1]

    not(-6>10 or-6==10)

  • 2]

    not(-6<10 or-6==10)

  • 3]

    -6>=0 and -6<=10

  • 4]

    not(-6<0 or-6>10)

Solution
3
Discuss

Which of the following expressions results in an error?

  • 1]

    int(‘1011’)

  • 2]

    int(1011,2)

  • 3]

    int(‘1011’,23)

  • 4]

    int(1011)

Solution
4
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
5
Discuss

Which of the following represents the bitwise XOR operator?

  • 1]

    !

  • 2]

    |

  • 3]

    ^

  • 4]

    &

Solution
6
Discuss

What will be the output of the following Python expression?

0x35 | 0x75

 

  • 1]

    118

  • 2]

    117

  • 3]

    119

  • 4]

    116

Solution
7
Discuss

What will be the output of the following Python code?

if (9 < 0) and (0 < -9):
    print("hello")
elif (9 > 0) or False:
    print("good")
else:
    print("bad")

 

  • 1]

    bad

  • 2]

    good

  • 3]

    hello

  • 4]

    error

Solution
8
Discuss

What will be the output of the following Python expression?

24//6%3, 24//4//2

 

  • 1]

    (3,1)

  • 2]

    (1,0)

  • 3]

    (0,3)

  • 4]

    (1,3)

Solution
9
Discuss

Any odd number on being AND-ed with ________ always gives 1. Hint: Any even number on being AND-ed with this value always gives 0.

  • 1]

    10

  • 2]

    2

  • 3]

    1

  • 4]

    0

Solution
10
Discuss

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

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

 

  • 1]

    %

  • 2]

    |

  • 3]

    **

  • 4]

    <<, >>

Solution
# Quiz