-
Hajipur, Bihar, 844101
Hajipur, Bihar, 844101
Difficulty Level: medium
Q1: What will be the output? (1 points)
x = float("7.2")
print(type(x))
Q2: What is the result of this code? (1 points)
print(type({1,2,3}) == type(frozenset([1,2,3])))
Q3: What will happen? (1 points)
x, y = 5, 10
x, y = y, x
print(x, y)
Q4: Which of the following will Python interpret as a docstring? (1 points)
Q5: What does this expression return? (1 points)
print(True + True * False)
Q6: What happens with this code? (1 points)
name = input("Enter: ")
print(type(name))
Q7: Identify the valid syntax: (1 points)
Q8: What will this code print? (1 points)
x = None
print(type(x) is type(None))
Q9: What is the output? (1 points)
print(2 ** 3 ** 2)
Q10: What will this print? (1 points)
a = [1,2,3]
b = a
b.append(4)
print(a)
Q11: What will this code output? (1 points)
print(int(7.9))
Q12: What is the result? (1 points)
print("Python", "Rocks", sep="-")
Q13: What will happen? (1 points)
if 0:
print("Yes")
else:
print("No")
Q14: What happens here? (1 points)
x = 5
def f():
global x
x = 10
f()
print(x)
Q15: What does this expression print? (1 points)
print(not (3>2 and 2<4))
Q16: What happens if triple quotes appear at the start of a script? (1 points)
Q17: What is the result? (1 points)
print(bool([]), bool([0]))
Q18: Which will fail? (1 points)
Q19: What is the output? (1 points)
print("A", end="")
print("B")
Q20: What is the output? (1 points)
x = "abc"
y = "abc"
print(x is y)
Q21: Which will cause an error? (1 points)
Q22: What happens? (1 points)
d = {1:"A", 2:"B"}
print(d.get(3, "C"))
Q23: Which statement is correct about #? (1 points)
Q24: What is the result? (1 points)
print(5 & 3)
Q25: Which statement is true? (1 points)
Q26: What is the output? (1 points)
print(str(10) + "5")
Q27: What is printed? (1 points)
x = [1,2,3]
print(id(x) == id([1,2,3]))
Q28: What does this print? (1 points)
print(10 % -3)
Q29: What will this print? (1 points)
print(len("Hello\nWorld"))
Q30: What is the result? (1 points)
print(type({}))
Welcome to the Python Basics Medium-Level Quiz! This quiz is designed to test your understanding of core Python concepts such as syntax, comments, variables, data types, casting, operators, and input/output operations. It contains 30 multiple-choice questions (MCQs), each carefully selected to challenge your logical thinking and application skills, rather than just memorization.
How to Attempt the Quiz:
Each question has four options, but only one correct answer.
Read each question carefully before selecting your answer. Some questions involve code snippets, so pay attention to indentation, operators, and data types.
Take your time to think about the output or behavior of the code rather than guessing. Medium-level questions are intended to stretch your understanding.
Scoring and Feedback:
Each correct answer gives you 1 point.
After completing the quiz, you will receive a full score report showing which questions were correct or incorrect.
Detailed explanations (50–60 words each) are provided for every question so you can learn from mistakes and reinforce your knowledge.
Time Management:
Estimated completion time is 25–30 minutes.
Try to attempt all questions in a single sitting for the best learning experience.
Tips for Success:
Review basic Python syntax and commonly used operators before attempting the quiz.
Think critically about the logic in code snippets; medium-level questions often test conceptual understanding and problem-solving skills.
Avoid rushing — understanding why an answer is correct is more valuable than just scoring points.
Good luck! Use this quiz as an opportunity to strengthen your Python fundamentals and prepare for more advanced programming challenges.
