Quiz Discussion

What will be the output of the following Python expression?

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

 

Course Name: Python

  • 1]

    (3,1)

  • 2]

    (1,0)

  • 3]

    (0,3)

  • 4]

    (1,3)

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 snippet?

bool(‘False’)
bool()

 

  • 1]
    True
    True
  • 2]

    False
    True

  • 3]

    True
    False

  • 4]

    False
    False

Solution
2
Discuss

What will be the output of the following Python expression?

bin(29)

 

  • 1]

    ‘0b11011’

  • 2]

    ‘0b11111’

  • 3]

    ‘0b11101’

  • 4]

    ‘0b10111’

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

Which of the following expressions is an example of type conversion?

  • 1]

    3 + 7

  • 2]

    5.0 + 3

  • 3]

    5.3 + 6.3

  • 4]

    4.0 + float(3)

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

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

x<<2

 

  • 1]

    4

  • 2]

    2

  • 3]

    1

  • 4]

    8

Solution
8
Discuss

Which of the following represents the bitwise XOR operator?

  • 1]

    !

  • 2]

    |

  • 3]

    ^

  • 4]

    &

Solution
9
Discuss

What will be the output of the following Python code?

l=[1, 0, 2, 0, 'hello', '', []]
list(filter(bool, l))

 

  • 1]

    [1, 2, ‘hello’]

  • 2]

    [1, 0, 2, ‘hello’, ”, []]

  • 3]

    [1, 0, 2, 0, ‘hello’, ”, []]

  • 4]

    Error

Solution
10
Discuss

What will be the output of the following Python code?

['f', 't'][bool('spam')]

 

  • 1]

    Error

  • 2]

    No output

  • 3]

    f

  • 4]

    t

Solution
# Quiz