Python Quizzes

Each Python quiz consists of ten questions, each question has three to five possible answers, at least one of them is correct. There may be multiple correct or incorrect answers. Check those answers that you think are correct, then click the "Submit Quiz" button. If you have answered at least 50% of the answers correctly, you are prepared to take Python a step further. Read the compact Python Tutorial on this site for a brief summary on these topics. Have fun!

 Quiz: Python Basics

Test your basic understanding of Python programming and language syntax by taking the quiz "Python Basics".

The topics of this quiz are: declaring variables, vectors and matrices via NumPy arrays, using Python built-in functions and user-defined functions, and creating figures with simple line plots.

 Quiz: Python Lists and Arrays

Python offers powerful support for array-like data, either through the built-in data structures of the Python standard library (lists, tuples, dictionaries) or through the more specialized datastructures of the NumPy package (NumPy ndarrays).

For Python beginners, it can be difficult to decide which data structure they should choose for their specific application. At a first glance, Python lists and NumPy ndarrays look similar and interchangeable, but they are fundamentally different datastructures and support different sets of operations and functions. In a nutshell: Python lists store data of arbitrary data type dynamically and support linked list and stack operations (insert, append, pop, sort, reverse, ...). NumPy arrays are an index data structure that stores data of the same data type in an efficient way with a primary focus on elementwise operations and statistic functions, useful for creating sequences, random numbers, multidimensional arrays. The following quiz should help to clarify some of the most frequents points of confusion.

 Quiz: Python Functions

A Python function is defined by the keyword def and a function name, round brackets () that enclose a parameter list, and a colon, followed by the statements defining the function. An important part is to learn how to call a function properly by providing the correct number of arguments. Also a bit tricky for beginners: when and how to use inline "lambda" functions.

Test your basic understanding of Python functions by taking the quiz "Python Functions". The topics of this quiz are: defining and using functions, passing arguments to functions, local and global variables, annotations, docstrings, lambda functions, vectorize functions. Read the Python Cheatsheet on this site for a brief summary on how to write and use functions.

Tools & References