Quiz Discussion

Which of the following expressions involves coercion when evaluated in Python?

Course Name: Python

  • 1]

    3.4 + 4.6

  • 2]

    1.7 % 2

  • 3]

    7.9 * 6.3

  • 4]

    4.7 – 1.5

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?

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

What will be the output of the following Python expression?

0x35 | 0x75

 

  • 1]

    118

  • 2]

    117

  • 3]

    119

  • 4]

    116

Solution
5
Discuss

To find the decimal value of 1111, that is 15, we can use the function:

  • 1]

    int(‘1111’,2)

  • 2]

    int(1111,2)

  • 3]

    int(‘1111’,10)

  • 4]

    int(1111,10)

Solution
6
Discuss

What will be the output of the following Python code?

class Truth:
	pass
x=Truth()
bool(x)

 

  • 1]

    error

  • 2]

    false

  • 3]

    true

  • 4]

    pass

Solution
7
Discuss

What is the value of the following Python expression?

bin(0x8)

 

  • 1]

    ‘0b1000’

  • 2]

    1000

  • 3]

    8

  • 4]

    ‘0bx1000’

Solution
8
Discuss

Which of the following expressions results in an error?

  • 1]

    int(’10.8’)

  • 2]

    float(’10.8’)

  • 3]

    int(‘10’)

  • 4]

    float(‘10’)

Solution
9
Discuss

Which of the following represents the bitwise XOR operator?

  • 1]

    !

  • 2]

    |

  • 3]

    ^

  • 4]

    &

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