Quiz Discussion

Which of the following expressions results in an error?

Course Name: Python

  • 1]

    int(’10.8’)

  • 2]

    float(’10.8’)

  • 3]

    int(‘10’)

  • 4]

    float(‘10’)

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

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 among the following list of operators has the highest precedence?

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

 

  • 1]

    %

  • 2]

    |

  • 3]

    **

  • 4]

    <<, >>

Solution
5
Discuss

Which of the following expressions can be used to multiply a given number ‘a’ by 4?

  • 1]

    a>>4

  • 2]

    a>>2

  • 3]

    a<<4

  • 4]

    a<<2

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

What will be the output of the following Python expression?

bin(29)

 

  • 1]

    ‘0b11011’

  • 2]

    ‘0b11111’

  • 3]

    ‘0b11101’

  • 4]

    ‘0b10111’

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