-
Hajipur, Bihar, 844101
Hajipur, Bihar, 844101
Difficulty Level: easy
Q1: Which of the following is the correct way to print "Hello World" in Python? (1 points)
Q2: What is the correct file extension for Python files? (1 points)
Q3: What will be the output of this code? (1 points)
x = 5
y = "5"
print(x + int(y))
Q4: Which of these is a valid variable name in Python? (1 points)
Q5: Which of the following is used to add a single-line comment in Python? (1 points)
Q6: What is the output? (1 points)
print(10 // 3)
Q7: Which function is used to take input from the user? (1 points)
Q8: What will be the output of this code? (1 points)
x = int(3.7)
print(x)
Q9: Which operator is used for string concatenation in Python? (1 points)
Q10: Which keyword is used to declare a variable in Python? (1 points)
Q11: What is the output? (1 points)
print(2 ** 3)
Q12: Which of the following is an immutable data type in Python? (1 points)
Q13: What will be printed? (1 points)
x = str(25)
print(x + "5")
Q14: What happens if you miss indentation in Python code? (1 points)
Q15: Which function is used to display output in Python? (1 points)
Q16: What is the data type of this variable? (1 points)
x = "123"
Q17: What is the output? (1 points)
x = 5
y = 2
print(x % y)
Q18: What will this code output if the user enters Python? (1 points)
name = input("Enter your name: ")
print("Hello", name)
Q19: Which of the following is the assignment operator in Python? (1 points)
Q20: What will this code output? (1 points)
print(5 > 3 and 2 < 1)
Q21: Which of the following is not a valid way to add comments in Python? (1 points)
Q22: What type is the variable here? (1 points)
a = True
Q23: What will be the output? (1 points)
x = [1, 2, 3]
print(type(x))
Q24: What will this code print? (1 points)
x = 10
x = "Hello"
print(x)
Q25: Which function is used to convert a string to a float in Python? (1 points)
Q26: What is the output when user enters 10? (1 points)
x = input("Enter number: ")
print(type(x))
Q27: What will happen here? (1 points)
x = "abc"
y = int(x)
Q28: Which of the following defines Python code blocks? (1 points)
Q29: What will the following code do? (1 points)
print("Hello") # This prints Hello
Q30: Which operator will compare values for equality? (1 points)
Welcome to the Python Basics Quiz 🎉
This quiz is designed to test your knowledge of Python fundamentals in a fun, interactive way. Please read the instructions before starting:
Quiz Format
Total Questions: 30
Question Types: Multiple Choice + Small Code Output Questions
Each question has one correct answer.
Timing
You will get 30 seconds per question.
The entire quiz will take 15 minutes to complete.
Scoring
Each correct answer = +1 point
No negative marking for wrong answers
Maximum Score = 30 points
How to Play
Read each question carefully.
Select the option you think is correct.
Once you move to the next question, you cannot go back.
Rules
Don’t refresh or close the page during the quiz.
Use your own knowledge (no copying from Google!).
Keep track of your time to stay within the limit.
After Submission
Your total score will be displayed immediately.
You can also review the correct answers and explanations to learn from mistakes.