Loading...
Quiz: Python Arrays and Functions
Practice arrays (lists) and functions in Python. This interactive quiz covers list operations, function syntax, arguments, return values, and more.
1.
What is used in Python as an alternative to traditional arrays?
2.
Which method would you use to add an item to the end of a list?
3.
What will the following code output?
python
2 lines
|15/ 500 tokens
1 2car_brands = ["Tesla", "Ford", "BMW"] print(car_brands[1])
Code Tools
4.
What does the following function do?
python
2 lines
|14/ 500 tokens
1 2def greet(name="Guest"): print(f"Hello, {name}!")
Code Tools
5.
How can you pass a variable number of arguments to a function?