Quiz Discussion

What will be the output of the following Python code?

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

 

Course Name: Python

  • 1]

    he

  • 2]

    olleh

  • 3]

    lo

  • 4]

    hello

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

The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same.

  • 1]

    True

  • 2]

    False

Solution
2
Discuss

Given a function that does not return any value, What value is thrown by default when executed in shell.

  • 1]

    int

  • 2]

    bool

  • 3]

    void

  • 4]

    None

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 error occurs when you execute the following Python code snippet?

apple = mango

 

  • 1]

    SyntaxError

  • 2]

    NameError

  • 3]

    ValueError

  • 4]

    TypeError

Solution
5
Discuss

Which one of these is floor division?

  • 1]

    /

  • 2]

    %

  • 3]

    //

  • 4]

    None of the mentioned

Solution
6
Discuss

Which of the following is the truncation division operator?

  • 1]

    /

  • 2]

    %

  • 3]

    //

  • 4]

    |

Solution
7
Discuss

Which one of the following has the highest precedence in the expression?

  • 1]

    Exponential

  • 2]

    Addition

  • 3]

    Parentheses

  • 4]

    Multiplication

Solution
8
Discuss

The following is displayed by a print function call. Select all of the function calls that result in this output.

tom
dick
harry

 

  • 1]

    print(”’tomdickharry”’)

  • 2]
    print('''tom
    \ndick
    \nharry''')
  • 3]
    print('tom
    dick
    harry')
  • 4]

    print(‘tom\ndick\nharry’)

Solution
9
Discuss

What is the return type of function id?

  • 1]

    int

  • 2]

    float

  • 3]

    dict

  • 4]

    bool

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