- Which of the following is used for conditional branching in Python?
View Answer
Correct answer: A — if
- What will be printed?
1 x = 5 2 if x > 3: 3 print("Eduinq") View Answer
Correct answer: A — Eduinq
- Which of the following is used for looping in Python?
View Answer
Correct answer: C — Both A and B
- What is the output of print(2 < 3 and 4 > 5)?
View Answer
Correct answer: B — False
- Which of the following is used to skip current iteration in a loop?
View Answer
Correct answer: B — continue
- What will be printed?
1 for i in range(3): 2 print(i) View Answer
Correct answer: A — 0 1 2
- Which of the following is used to terminate a loop?
View Answer
Correct answer: C — break
- What is the output of print(5==5 or 2==3)?
View Answer
Correct answer: A — True
- Which of the following is used to execute code when condition is false?
View Answer
Correct answer: B — else
- What will be printed?
1 x = 2 2 if x == 2: 3 print("Eduinq") 4 else: 5 print("Python") View Answer
Correct answer: A — Eduinq
- Which of the following is used for multiple conditions?
View Answer
Correct answer: C — elif
- What is the output of print(not(2 > 3))?
View Answer
Correct answer: A — True
- Which of the following is used to define infinite loop?
View Answer
Correct answer: A — while True
- What will be printed?
1 for i in range(1,4): 2 print(i) View Answer
Correct answer: A — 1 2 3
- Which of the following is used to execute code when condition is true?
View Answer
Correct answer: A — if
- What is the output of print(2 > 3 or 4 < 5)?
View Answer
Correct answer: A — True
- Which of the following is used to define empty loop body?
View Answer
Correct answer: C — pass
- What will be printed?
1 x = 10 2 while x > 7: 3 print("Eduinq") 4 x -= 1 View Answer
Correct answer: C — Eduinq Eduinq Eduinq Eduinq
- Which of the following is used to combine conditions?
View Answer
Correct answer: D — Both A and B
- What is the output of print(2 < 3 and not(4 < 5))?
View Answer
Correct answer: B — False
- Which of the following is used to iterate over sequence?
View Answer
Correct answer: A — for
- What will be printed?
1 for i in "Eduinq": 2 print(i, end="") View Answer
Correct answer: A — Eduinq
- Which of the following is used to exit from nested loops?
View Answer
Correct answer: A — break
- What is the output of print(2==2 and 3!=4)?
View Answer
Correct answer: A — True
- Which of the following is used to check multiple conditions sequentially?
View Answer
Correct answer: A — if-else ladder
- What will be printed?
1 x = 0 2 while x < 3: 3 print(x) 4 x += 1 View Answer
Correct answer: A — 0 1 2
- Which of the following is used to check condition inside loop?
View Answer
Correct answer: A — if
- What is the output of print(2 < 3 and 4 > 5 or 6 == 6)?
View Answer
Correct answer: A — True
- Which of the following is used to define conditional expression?
View Answer
Correct answer: C — Both A and B
- What will be printed?
1 x = 5 2 if x % 2 == 0: 3 print("Even") 4 else: 5 print("Odd") View Answer
Correct answer: B — Odd
- Which of the following is used to check condition in loop header?
View Answer
Correct answer: C — Both A and B
- What is the output of print(2 > 3 or 4 > 5)?
View Answer
Correct answer: B — False
- Which of the following is used to define conditional block?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 for i in range(2,5): 2 print(i) View Answer
Correct answer: A — 2 3 4
- Which of the following is used to define loop with condition?
View Answer
Correct answer: C — Both A and B
- What is the output of print(not(2==2))?
View Answer
Correct answer: B — False
- Which of the following is used to define loop with sequence?
View Answer
Correct answer: A — for
- What will be printed?
1 x = 3 2 if x > 5: 3 print("Eduinq") 4 else: 5 print("Python") View Answer
Correct answer: B — Python
- Which of the following is used to define conditional loop?
View Answer
Correct answer: B — while
- What will be printed?
1 x = 0 2 if x: 3 print("Eduinq") 4 else: 5 print("Python") View Answer
Correct answer: B — Python
- Which of the following is used to check multiple conditions in one line?
View Answer
Correct answer: B — Ternary operator
- What is the output of print(2 < 3 < 4)?
View Answer
Correct answer: A — True
- Which of the following is used to define conditional loop with exit?
View Answer
Correct answer: C — Both A and B
- What will be printed?
1 for i in range(0,5,2): 2 print(i) View Answer
Correct answer: A — 0 2 4
- Which of the following is used to define conditional branching with multiple options?
View Answer
Correct answer: A — if-elif-else
- What is the output of print(2==2 and 3==3)?
View Answer
Correct answer: A — True
- Which of the following is used to define loop with condition check at start?
View Answer
Correct answer: B — while
- What will be printed?
1 for i in range(3): 2 if i == 1: 3 continue 4 print(i) View Answer
Correct answer: B — 0 2
- Which of the following is used to define conditional block with multiple branches?
View Answer
Correct answer: D — All of the above
- What is the output of print(2 > 1 and 3 < 4)?
View Answer
Correct answer: A — True