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. 1 / 50 Category: Syntax & Errors 1. def fun(): print("Hi") a. Name Error b. Indentation Error c. No Error d. Syntax Error 2 / 50 Category: Syntax & Errors 2. if 5 > 3 print("Yes") a. Syntax Error b. No Error c. Logical Error d. Indentation Error 3 / 50 Category: Syntax & Errors 3. a = [1,2,3] print(a[5]) a. 3 b. IndexError c. None d. KeyError 4 / 50 Category: Syntax & Errors 4. list = 10 print(list[0]) a. 0 b. IndexError c. TypeError d. 1 5 / 50 Category: Syntax & Errors 5. int("abc") a. ValueError b. 0 c. abc d. TypeError 6 / 50 Category: Syntax & Errors 6. print(unknown) a. 0 b. SyntaxError c. unknown d. NameError 7 / 50 Category: Syntax & Errors 7. print(10 / 0) a. 0 b. SyntaxError c. ZeroDivisionError d. infinity 8 / 50 Category: Syntax & Errors 8. print("Hello) a. Value Error b. Syntax Error c. Name Error d. No Error 9 / 50 Category: Syntax & Errors 9. print(x) a. 0 b. x is printed c. SyntaxError d. NameError 10 / 50 Category: Syntax & Errors 10. for i in range(5) print(i) a. No Error b. Name Error c. Syntax Error d. Type Error 11 / 50 Category: Output Based Questions 1. print(bool(0)) a. False b. True c. Error d. 0 12 / 50 Category: Output Based Questions 2. print(type("10")) a. string b. float c. int 13 / 50 Category: Output Based Questions 3. print(10 / 2) a. Error b. 2 c. 5 d. 5.0 14 / 50 Category: Output Based Questions 4. a = [1,2,3] print(len(a)) a. 3 b. 2 c. Error d. 1 15 / 50 Category: Output Based Questions 5. print(10 == 10) a. 10 b. False c. True d. Error 16 / 50 Category: Output Based Questions 6. print(10 > 5) a. 10 b. Error c. True d. False 17 / 50 Category: Output Based Questions 7. print(type(3.14)) a. decimal b. int c. float 18 / 50 Category: Output Based Questions 8. print(2 ** 3) a. 8 b. Error c. 9 d. 6 19 / 50 Category: Output Based Questions 9. x = 5 x += 3 print(x) a. 8 b. 2 c. 5 d. Error 20 / 50 Category: Output Based Questions 10. print(len("Python")) a. 7 b. 6 c. 8 d. 5 21 / 50 Category: Output Based Questions 11. print("Python"[0]) a. P b. y c. Error d. Python 22 / 50 Category: Output Based Questions 12. x = 10 print(x) a. Error b. 0 c. 10 d. x 23 / 50 Category: Output Based Questions 13. print("Hello" + "World") a. HelloWorld b. Error c. Hello+World d. Hello World 24 / 50 Category: Output Based Questions 14. print(5 + 3) a. None b. 53 c. Error d. 8 25 / 50 Category: Output Based Questions 15. print(5 % 2) a. 2 b. Error c. 0 d. 1 26 / 50 Category: Fill in the Blanks 1. The value of True in Python is __________. a. true b. 0 c. True d. 1 27 / 50 Category: Fill in the Blanks 2. __________ function returns the length of a list. a. len() b. size() c. length() d. count() 28 / 50 Category: Fill in the Blanks 3. Lists in Python are enclosed within __________ brackets. a. () b. {} c. [] 29 / 50 Category: Fill in the Blanks 4. The correct file extension for Python files is __________. a. .pyt b. .py c. .python d. .pt 30 / 50 Category: Fill in the Blanks 5. The symbol used for comments in Python is __________. a. # b. // c. <!-- --> d. /**/ 31 / 50 Category: Fill in the Blanks 6. Python was created by __________. a. James Gosling b. Guido van Rossum c. Bjarne Stroustrup d. Dennis Ritchie 32 / 50 Category: Fill in the Blanks 7. Python is a __________ level programming language. a. Machine b. Low c. High d. Assembly 33 / 50 Category: Fill in the Blanks 8. The output of print(type(10)) is __________. a. number b. int c. integer 34 / 50 Category: Fill in the Blanks 9. __________ keyword is used to check a condition in Python. a. if b. while c. check d. for 35 / 50 Category: Fill in the Blanks 10. __________ is used to exit a loop in Python. a. end b. break c. exit d. stop 36 / 50 Category: Fill in the Blanks 11. Python is an __________ language. a. Binary b. Interpreted c. Compiled d. Assembled 37 / 50 Category: Fill in the Blanks 12. The multiplication operator in Python is __________. a. * b. x c. X d. % 38 / 50 Category: Fill in the Blanks 13. __________ is used to take input from the user in Python. a. get() b. scan() c. input() d. read() 39 / 50 Category: Fill in the Blanks 14. The keyword used to define a function in Python is __________. a. function b. fun c. def d. define 40 / 50 Category: Fill in the Blanks 15. Python is a __________ typed language. a. Weakly b. Statically c. Strongly d. Dynamically 41 / 50 Category: True / False 1. Indentation is mandatory in Python. a. False b. True 42 / 50 Category: True / False 2. Tuples are mutable data types. a. False b. True 43 / 50 Category: True / False 3. = is a comparison operator in Python. a. False b. True 44 / 50 Category: True / False 4. while loop executes at least once. a. False b. True 45 / 50 Category: True / False 5. None represents absence of a value. a. True b. False 46 / 50 Category: True / False 6. Python supports multiple inheritance. a. True b. False 47 / 50 Category: True / False 7. Python supports object-oriented programming. a. True b. False 48 / 50 Category: True / False 8. print() is used for input in Python. 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. Python is case-sensitive. 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 Prajjwal Singh Tech Blogger || Web developer || Computer Networking Enthusiast || Microsoft SQL Database Management Expert || Software Debugger || Learned DOS OS Structure You Might Also Like Conditional Construct In Python October 30, 2023 Learn Python: A Comprehensive Guide for Beginners May 18, 2025 Looping Construct In Python March 20, 2024 Leave a ReplyCancel reply