GATE DA Python Basics, Control Flow, Operators & Functions | Set 1

Questions 1-5 of 100

0% completed (0/100 answered)
Your score 0/100 0 answered
Correct 0 Incorrect 0 Unanswered 100 Accuracy 0%

Question 1

MCQ · Single Correct 1 mark

What will be the output of the following Python code snippet?
a = 7.5
b = 2.0
c = 3
d = -3.0
e = a // b
f = d // c
print(e + f)

Answers for question 1

Question 2

MCQ · Single Correct 1 mark

Which of the following represents the correct ascending order of operator precedence in Python (from lowest to highest precedence)?
1. not in
2. <<
3. not
4. ^

Answers for question 2

Question 3

NAT · Numerical Answer 1 mark

What is the result of evaluating the expression in Python?
result = 18 & 5 + 3 << 2 ^ 24 + 4 // 5

Answers for question 3

Question 4

MCQ · Single Correct 1 mark

Consider the following statement: 'Python evaluates expression A ** B ** C from right to left, whereas expression A + B - C is evaluated from left to right.' Which of the following options accurately describes operator associativity?

Answers for question 4

Question 5

NAT · Numerical Answer 1 mark

What will be the output of the following code segment?
a = 0o37
b = a << 2
c = a >> 2
print(b + c)

Answers for question 5
Scroll to Top