All Templates

Python Fundamentals

Test your Python knowledge with questions on data types, control flow, list comprehensions, decorators, and built-in functions. Great for beginners and intermediate developers.

EASY7 questions10 minProgramming

Question Preview

1.What is the output of type([]) in Python?
<class 'list'>
<class 'array'>
<class 'tuple'>
<class 'set'>
EASYMultiple Choice
2.What is a list comprehension in Python?
A concise syntax to create lists from iterables using a single expression
A method that sorts lists in place
A way to define classes that behave like lists
A function that merges multiple lists together
EASYMultiple Choice
3.What is the difference between a tuple and a list in Python?
Tuples are immutable and use parentheses; lists are mutable and use square brackets
Tuples can only store numbers; lists can store any type
Lists are faster than tuples in all operations
There is no difference; they are interchangeable
EASYMultiple Choice

+ 4 more questions included in the full template