PYTHON QUIZ
1 .
Operators with the same precedence are evaluated in which manner?

Correct Answer : Option (A)

Left to Right
  Show Answer
2 .
What does ~4 evaluate to?

Correct Answer : Option (A)

-5
  Show Answer
3 .
What is the output of this expression, 3*1**3?

Correct Answer : Option (B)

3

Explanation : First this expression will solve 1**3 because exponential has higher precedence than multiplication, so 1**3 = 1 and 3*1 = 3. Final answer is 3.

  Show Answer
4 .
What does ~~~~~~5 evaluate to?

Correct Answer : Option (A)

+5

Explanation : ~x is equivalent to -(x+1)

  Show Answer
5 .
Which one of the following has the highest precedence in the expression?

Correct Answer : Option (C)

Parentheses
  Show Answer
6 .
Which of the following is incorrect?

Correct Answer : Option (B)

float(’12+34′)

Explanation : ‘+’ cannot be converted to a float.

  Show Answer
7 .
Which of the following has more precedance?

Correct Answer : Option (C)

()
  Show Answer
8 .
What will be the output of 7^10 in python?

Correct Answer : Option (B)

13
  Show Answer
9 .
Which of the following is the use of id() function in python?

Correct Answer : Option (A)

Id returns the identity of the object
  Show Answer
10 .
What will be the value of the following Python expression?
 
4 + 3 % 5

Correct Answer : Option (D)

7
  Show Answer