πŸ“Š Python
Q. The following is used to define a ___.
Code:
d = {
	<key>: <value>,
	<key>: <value>,
	.
	.
	.
	<key>: <value>
}
  • (A) Group
  • (B) List
  • (C) Dictionary
  • (D) All of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (C) Dictionary
πŸ“Š Python
Q. Conditional statements are also known as ___ statements.
  • (A) Decision-making
  • (B) Array
  • (C) List
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (A) Decision-making
πŸ“Š Python
Q. Amongst which of the following if syntax is true?
  • (A) if condition: #Will executes this block if the condition is true
  • (B) if condition { #Will executes this block if the condition is true }
  • (C) if(condition) #Will executes this block if the condition is true
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (A) if condition: #Will executes this block if the condition is true
πŸ“Š Python
Q. Amongst which of the following is / are the conditional statement in Python code?
  • (A) if a<=100:
  • (B) if (a >= 10)
  • (C) if (a => 200)
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (A) if a<=100:
πŸ“Š Python
Q. Which of the following is not used as conditional statement in Python?
  • (A) switch
  • (B) if...else
  • (C) elif
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (A) switch
πŸ“Š Python
Q. Which of the following is false regarding conditional statement in Python?
  • (A) If-elif is the shortcut for the if-else chain
  • (B) We use the dictionary to replace the Switch case statement
  • (C) We cannot use python classes to implement the switch case statement
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (C) We cannot use python classes to implement the switch case statement
πŸ“Š Python
Q. In a Python program, Nested if Statements denotes?
  • (A) if statement inside another if statement
  • (B) if statement outside the another if statement
  • (C) Both A and B
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (A) if statement inside another if statement
πŸ“Š Python
Q. What will be the output of the following Python code?
Code:
a=7
if a>4: print("Greater")
  • (A) Greater
  • (B) 7
  • (C) 4
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (A) Greater
πŸ“Š Python
Q. What will be the output of the following Python code?
Code:
x,y = 12,14

if(x+y==26):
    print("true")
else:
    print("false")
  • (A) true
  • (B) false
  • (C) either A or B
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) true
πŸ“Š Python
Q. What will be the output of the following Python code?
Code:
x=13

if x>12 or x<15 and x==16:
    print("Given condition matched")
else:
    print("Given condition did not match")
  • (A) Given condition matched
  • (B) Given condition did not match
  • (C) Both A and B
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (A) Given condition matched