Python Quiz for Beginners. 0% 0 Oops! Time up! Python programming Python Basic Quiz This Quiz for beginners. You can enhance and check your knowledge in python after attending this quiz. Login Here. NameEmail 1 / 50 Category: Syntax & Errors 1. for i in range(5) print(i) a. Syntax Error b. Type Error c. Name Error d. No Error 2 / 50 Category: Syntax & Errors 2. print(unknown) a. SyntaxError b. 0 c. NameError d. unknown 3 / 50 Category: Syntax & Errors 3. print(x) a. x is printed b. SyntaxError c. NameError d. 0 4 / 50 Category: Syntax & Errors 4. a = [1,2,3] print(a[5]) a. None b. 3 c. IndexError d. KeyError 5 / 50 Category: Syntax & Errors 5. print(10 / 0) a. SyntaxError b. infinity c. 0 d. ZeroDivisionError 6 / 50 Category: Syntax & Errors 6. list = 10 print(list[0]) a. 1 b. IndexError c. 0 d. TypeError 7 / 50 Category: Syntax & Errors 7. print("Hello) a. Value Error b. Name Error c. Syntax Error d. No Error 8 / 50 Category: Syntax & Errors 8. def fun(): print("Hi") a. Name Error b. Indentation Error c. Syntax Error d. No Error 9 / 50 Category: Syntax & Errors 9. if 5 > 3 print("Yes") a. No Error b. Syntax Error c. Indentation Error d. Logical Error 10 / 50 Category: Syntax & Errors 10. int("abc") a. abc b. ValueError c. TypeError d. 0 11 / 50 Category: Fill in the Blanks 1. The correct file extension for Python files is __________. a. .pt b. .python c. .pyt d. .py 12 / 50 Category: Fill in the Blanks 2. The value of True in Python is __________. a. 0 b. 1 c. true d. True 13 / 50 Category: Fill in the Blanks 3. __________ function returns the length of a list. a. length() b. len() c. size() d. count() 14 / 50 Category: Fill in the Blanks 4. Python was created by __________. a. James Gosling b. Bjarne Stroustrup c. Dennis Ritchie d. Guido van Rossum 15 / 50 Category: Fill in the Blanks 5. __________ keyword is used to check a condition in Python. a. while b. if c. check d. for 16 / 50 Category: Fill in the Blanks 6. Lists in Python are enclosed within __________ brackets. a. () b. {} c. [] 17 / 50 Category: Fill in the Blanks 7. The keyword used to define a function in Python is __________. a. def b. function c. fun d. define 18 / 50 Category: Fill in the Blanks 8. The symbol used for comments in Python is __________. a. /**/ b. # c. <!-- --> d. // 19 / 50 Category: Fill in the Blanks 9. Python is a __________ level programming language. a. High b. Machine c. Low d. Assembly 20 / 50 Category: Fill in the Blanks 10. Python is a __________ typed language. a. Statically b. Dynamically c. Strongly d. Weakly 21 / 50 Category: Fill in the Blanks 11. __________ is used to exit a loop in Python. a. stop b. break c. end d. exit 22 / 50 Category: Fill in the Blanks 12. The multiplication operator in Python is __________. a. % b. x c. * d. X 23 / 50 Category: Fill in the Blanks 13. The output of print(type(10)) is __________. a. integer b. number c. int 24 / 50 Category: Fill in the Blanks 14. __________ is used to take input from the user in Python. a. read() b. scan() c. input() d. get() 25 / 50 Category: Fill in the Blanks 15. Python is an __________ language. a. Binary b. Interpreted c. Assembled d. Compiled 26 / 50 Category: Output Based Questions 1. print(2 ** 3) a. Error b. 9 c. 8 d. 6 27 / 50 Category: Output Based Questions 2. x = 5 x += 3 print(x) a. Error b. 8 c. 5 d. 2 28 / 50 Category: Output Based Questions 3. print(5 % 2) a. 0 b. Error c. 1 d. 2 29 / 50 Category: Output Based Questions 4. print(10 / 2) a. 5.0 b. 2 c. 5 d. Error 30 / 50 Category: Output Based Questions 5. print(type("10")) a. int b. float c. string 31 / 50 Category: Output Based Questions 6. print(bool(0)) a. 0 b. Error c. True d. False 32 / 50 Category: Output Based Questions 7. print("Python"[0]) a. P b. Error c. Python d. y 33 / 50 Category: Output Based Questions 8. a = [1,2,3] print(len(a)) a. 3 b. 2 c. Error d. 1 34 / 50 Category: Output Based Questions 9. print(type(3.14)) a. int b. decimal c. float 35 / 50 Category: Output Based Questions 10. x = 10 print(x) a. 0 b. Error c. x d. 10 36 / 50 Category: Output Based Questions 11. print(5 + 3) a. None b. 53 c. Error d. 8 37 / 50 Category: Output Based Questions 12. print(10 > 5) a. 10 b. True c. False d. Error 38 / 50 Category: Output Based Questions 13. print(10 == 10) a. 10 b. Error c. False d. True 39 / 50 Category: Output Based Questions 14. print("Hello" + "World") a. Hello World b. Error c. HelloWorld d. Hello+World 40 / 50 Category: Output Based Questions 15. print(len("Python")) a. 7 b. 8 c. 5 d. 6 41 / 50 Category: True / False 1. Tuples are mutable data types. a. False b. True 42 / 50 Category: True / False 2. Python is case-sensitive. a. True b. False 43 / 50 Category: True / False 3. Indentation is mandatory in Python. a. True b. False 44 / 50 Category: True / False 4. Python supports multiple inheritance. a. True b. False 45 / 50 Category: True / False 5. Python supports object-oriented programming. a. False b. True 46 / 50 Category: True / False 6. None represents absence of a value. a. True b. False 47 / 50 Category: True / False 7. = is a comparison operator in Python. a. False b. True 48 / 50 Category: True / False 8. while loop executes at least once. a. False b. True 49 / 50 Category: True / False 9. Python code runs faster than C language. a. True b. False 50 / 50 Category: True / False 10. print() is used for input in Python. a. False b. True Your score isThe average score is 0% 0% Restart quiz Rate the Quiz. Thank You For Rating Us! Send feedback Like this: Table of Contents ToggleLike this: Like Loading...Share post Please Share This Share this content Opens in a new window Opens in a new window Opens in a new window Opens in a new window Read more articles Previous PostLearn Python: A Comprehensive Guide for Beginners Next PostPython List Datatype Quiz Prajjwal Singh Tech Blogger || Web developer || Computer Networking Enthusiast || Microsoft SQL Database Management Expert || Software Debugger || Learned DOS OS Structure You Might Also Like Learn Python: A Comprehensive Guide for Beginners May 18, 2025 Quiz on Python’s Tuple Datatype and their Functions. January 30, 2026 Install and Run Python Script in Linux OS September 9, 2022 Leave a ReplyCancel reply