Quiz Discussion

What will be the output of the following Python expression?

print(4.00/(2.0+2.0))

 

Course Name: Python

  • 1]

    1

  • 2]

    1.00

  • 3]

    1.0

  • 4]

    Error

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 of the following expressions results in an error?

  • 1]

    int(’10.8’)

  • 2]

    float(’10.8’)

  • 3]

    int(‘10’)

  • 4]

    float(‘10’)

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

What is the value of the following Python expression?

bin(0x8)

 

  • 1]

    ‘0b1000’

  • 2]

    1000

  • 3]

    8

  • 4]

    ‘0bx1000’

Solution
4
Discuss

What will be the output of the following Python expression?

~100?

 

  • 1]

    -100

  • 2]

    100

  • 3]

    -101

  • 4]

    101

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

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

  • 1]

    3.4 + 4.6

  • 2]

    1.7 % 2

  • 3]

    7.9 * 6.3

  • 4]

    4.7 – 1.5

Solution
8
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
9
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
10
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
# Quiz