Download 250 Python Multiple-Choice Questions for Practice and more Quizzes Computer Programming in PDF only on Docsity!
a
b
c
d
C H I P S I Z E D ' S
MULTIPLE CHOICES
ANSWERS INCLUDED ALL IMPORTANT TOPICS COVERED
Preface 250 Python Quizzes
Kindly Read This !!! Thanks a lot for purchasing our book. We are thrilled to present this compilation of 250 engaging and thought-provoking Python quizzes that are certain to challenge and enrich your understanding of this versatile programming language. As full-time freelancers and ardent Python enthusiasts, we were clear on meticulously crafting the quizzes from scratch. Unlike generic internet questions , each quiz on these pages reflects our commitment to offering you a unique and enlightening learning experience. Countless hours were invested in researching, designing, and refining each question to ensure that they test your knowledge and inspire a deeper exploration of Python's concepts. We wanted to provide a resource that caters to both beginners seeking to solidify their basics and seasoned developers aiming to challenge their expertise. Your support gives us a lot of confidence. As freelancers, we've poured our passion into this book, and your appreciation fuels our drive to create more valuable content. If you find this book beneficial and wish to extend your support, we kindly invite you to consider supporting this project financially through our Buy Me A Coffee page. Every contribution, no matter how small, goes a long way in helping us continue our mission of spreading knowledge. For any doubts and clarifications, we encourage you to connect with us on LinkedIn. We create content on different platforms like Medium , Gumroad , and LinkedIn. You can follow us through these links to consume more Python content. You can get my free Python Handwritten Notes from Gumroad as well which has over 2900 sales. Get to know all our work through our LinkTree account. We believe that learning should be an immersive and enjoyable experience, and we hope that this philosophy shines through in every quiz we've crafted. Happy Coding !!! Thanks and Regards Chip Sized
Introduction to Python 250 Python Quizzes
Introduction to Python
- Who is the founder of Python? A) Dennis Ritchie B) Bjarne Stroustrup C) Guido van Rossum D) James Gosling
- Which of the following extensions is used in a Python file? A) .pyth B) .p C) .python D) .py
- In which year was Python initially released? A) 1989 B) 1991 C) 1987 D) 1994
- Is Python compiled or interpreted? A) Interpreted B) Compiled C) Both Compiled and Interpreted D) None of the Above
Introduction to Python 250 Python Quizzes
- There are ____ keywords in Python 3.11 (currently the latest version). A) 33 B) 35 C) 30 D) 38
- Which among the following is the full form of PIP? A) Python Index Packaging B) Preferred Installer Program C) Python Installer Program D) PIP Installs Python
- Which symbol is used to write a single-line comment in Python? A) # B)! C) * D) /
- Which of the following is not a built-in function in Python? A) print() B) sqrt() C) ascii() D) sorted()
- Which of the following is an application of Python? A) Machine Learning B) Data Science C) Web Development D) All of the Above
The Print Function 250 Python Quizzes
The Print Function
- What is the output of the following code? print('pyt.', 'hon') A) python B) pyt. hon C) pyt hon D) pyt.hon
- What is the output of the following code? print('10' + '20') A) 10 20 B) 1020 C) 30 D) 10 + 20
- Choose the correct code that would display the following output. ABBBC A) print('A' + 'B' + 'C', sep='B') B) print('ABB', 'BC') C) print('A', 'B', 'C', sep='B') D) print('A' + 'C', sep='BBB')
The Print Function 250 Python Quizzes
- What is the default value of the 'end' argument used in the print( ) function? A) end=' ' B) end='\n' C) end=',' D) end='\t'
- What is the output of the following code? print("Hello World", sep='%') A) Hello World B) Hello World% C) Hello%World D) Error
- What is the output of the following code? print('code", 'blocks', sep='', end='') A) codeblocks B) codeblocks C) code blocks D) Error
- Choose the correct code that would display the following output. lemon+cake+ A) print('lemon' + 'cake', sep='+', end='+') B) print('lemon' + 'cake', end='+') C) print('lemon', 'cake', sep='+', end='+') D) print('lemon+', 'cake', end='+')
Variables and Keywords - 01 250 Python Quizzes
Variables and Keywords - 01
- Which of the following is an invalid variable name in Python? A) yield B) true C) C D) a_b_c
- What is the correct Python syntax to store the value 347 in a variable named n? A) n == 347 B) 347 = n C) int n = 347 D) n = 347
- Which of the following is a valid variable name in Python? A) var% B) none C) pass D) 8num
- What is the output of the following code? a = 100 b = 200 b = a a = b print(b, a) A) 100 200 B) 200 100 C) 100 100 D) 200 200
Variables and Keywords - 01 250 Python Quizzes
- What is the output of the following code? p = q q = 'hello' print(p) A) hello B) q C) Blank Output D) Error
- Which of the following is not a keyword in Python? A) except B) final C) from D) global
- What is the output of the following code? r = 5 + 8 print('r') A) 5 + 8 B) r C) 13 D) Error
- How many keywords (as of Python 3.11) are not completely lowercase? A) 2 B) 5 C) 3 D) 4
Variables and Keywords - 02 250 Python Quizzes
Variables and Keywords - 02
- Which of the following keywords is not used as an operator? A) is B) in C) or D) as
- What is the syntax to assign the number 76 to variables r, s, and t using a single line? A) r + s + t = 76 B) r = s = t = 76 C) r, s, t = 76 D) r, s, t = 76 * 3
- What is the output of the following code? x, y, z = 'y', 'z', 'x' print(z, 'x', y) A) y z x B) x y z C) x x z D) y x z
- Which of the following is a keyword in Python? A) default B) del C) false D) local
Variables and Keywords - 02 250 Python Quizzes
- What is the output of the following code? a, b, c = 3, 8, 5 d = b - c b = d + a a = b - c print(d, a, b, c) A) 1 6 5 3 B) 3 1 6 5 C) 3 3 8 5 D) 3 1 8 5
- On executing the following code, how many objects has Python created? val = 'code' var = val A) 0 B) 3 C) 2 D) 1
- On executing the following code, how many references has Python created? val = 758 var = val A) 2 B) 0 C) 3 D) 1
Data Types - 01 250 Python Quizzes
Data Types - 01
- How is the dictionary data type represented in Python? A) dict B) dictionary C) dic D) dicts
- Which of the following values is not a tuple? A) ('A') B) 10, 20 C) ([10], [20]) D) (10,)
- Which of the following values displays an error if printed? A) {10, 20, 10} B) {1: 10, 2: 20, 1: 30} C) {6, [2, 3], 5} D) [1, ['Hello'], 1]
- What is the output of the following code? a = 00 print(list(str(a)) A) ['00'] B) ['0'] C) ['0', '0'] D) Error
Data Types - 01 250 Python Quizzes
- What is the output of the following code? d = {1: 'A', 2: 'B', 1: 'C'} print(d) A) {1: 'A', 2: 'B'} B) {1: 'A', 2: 'B', 1: 'C'} C) {1: 'C', 2: 'B'} D) Error
- What is the output of the following code? data = '20.0', Print(type(data)) A) <class 'int'> B) <class 'float'> C) <class 'str'> D) <class 'tuple'>
- Which of the following is a scientific notation of 0.095 in Python? A) 9.5e- B) 9.5e C) 95e- D) 0.95e-
- Which of the following is an example of an implicit type conversion? A) String to List B) Integer to Float C) Tuple to List D) Float to Integer
Data Types - 02 250 Python Quizzes
Data Types - 02
- Which of the following is a mutable data type in Python? A) Integer B) Dictionary C) Complex D) String
- Which of the following represents an empty set in Python? A) [] B) set() C) {} D) ()
- What is the output of the following code? a = '01.01' print(int(a)) A) 01 B) 1 C) 1. D) Error
- Which of the following data type conversion is not possible in Python? A) String to Integer B) List to Tuple C) List to Integer D) Complex to String
Data Types - 02 250 Python Quizzes
- What is the output of the following code? num = 6 print(complex(num)) A) 6. B) 6j C) 6+0j D) Error
- What is the output of the following code? s = '123' print(list(s)) A) [1, 2, 3] B) [123] C) ['1', '2', '3'] D) ['123']
- What is the output of the following code? var = '100' print(int(var, 2)) A) 100 B) 2 C) 4 D) Error