Quiz Discussion

In python we do not specify types, it is directly interpreted by the compiler, so consider the following operation to be performed.

>>>x = 13 ? 2

the objective is to make sure x has an integer value, select all that apply

Course Name: Python

  • 1]

    x = 13 // 2

  • 2]

    x = int(13 / 2)

  • 3]

    x = 13 % 2

  • 4]

    All of the mentioned

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 one of the following has the same precedence level?

  • 1]

    Addition and Subtraction

  • 2]

    Multiplication, Division and Addition

  • 3]

    Multiplication, Division, Addition and Subtraction

  • 4]

    Addition and Multiplication

Solution
2
Discuss

What data type is the object below?

L = [1, 23, 'hello', 1]

 

  • 1]

    list

  • 2]

    dictionary

  • 3]

    array

  • 4]

    tuple

Solution
3
Discuss

What is the answer to this expression, 22 % 3 is?

  • 1]

    8

  • 2]

    1

  • 3]

    0

  • 4]

    2

Solution
4
Discuss

What will be the value of the following Python expression?

4 + 3 % 5

 

  • 1]

    4

  • 2]

    7

  • 3]

    2

  • 4]

    0

Solution
5
Discuss

What is the order of precedence in python?

i) Parentheses
ii) Exponential
iii) Multiplication
iv) Division
v) Addition
vi) Subtraction

  • 1]

    i,ii,iii,iv,v,vi

  • 2]

    ii,i,iii,iv,v,vi

  • 3]

    ii,i,iv,iii,v,vi

  • 4]

    i,ii,iii,iv,vi,v

Solution
6
Discuss

Which of the following results in a SyntaxError?

  • 1]

     ‘”Once upon a time…”, she said.’

  • 2]

    “He said, ‘Yes!'”

  • 3]

    ‘3\’

  • 4]

     ”’That’s okay”’

Solution
7
Discuss

Mathematical operations can be performed on a string.

  • 1]

    True

  • 2]

    False

Solution
8
Discuss

The expression Int(x) implies that the variable x is converted to integer.

  • 1]

    True

  • 2]

    False

Solution
9
Discuss

What will be the output of the following Python code?

>>>str="hello"
>>>str[:2]
>>>

 

  • 1]

    he

  • 2]

    olleh

  • 3]

    lo

  • 4]

    hello

Solution
10
Discuss

Which of the following operators has its associativity from right to left?

  • 1]

    +

  • 2]

    //

  • 3]

    %

  • 4]

    **

Solution
# Quiz