What is the difference between a list and a tuple in Python?
What does the following Python code output?
a = [1, 2, 3, 4, 5]
print(a[1:3])What does the 'pass' statement do in Python?
What is the output of: print(type([]) == type([1, 2, 3]))?
Which Python built-in function returns the number of items in an object?
What is a list comprehension in Python?
squares = [x**2 for x in range(5)]
print(squares)How do you create a function in Python that accepts any number of positional arguments?
What is the output of this code?
name = 'Python'
version = 3.12
print(f'{name} {version:.1f}')Which keyword is used to define a function in Python?
What is the correct file extension for Python files?
Which of these is a valid variable name in Python?
What is the output of print(type(5))?
print(type(5))What is the output of print(type(5.0))?
print(type(5.0))What is the boolean type in Python called?
Which of the following creates an empty dictionary?
Which of the following creates an empty set (not a dictionary)?
What data type does the following code produce?
s = {1, 2, 3}
print(type(s))What is the output of 10 // 3 in Python?
print(10 // 3)What is the output of 10 % 3 in Python?
print(10 % 3)What does the ** operator do in Python?
print(2 ** 3)Showing 1โ20 of 121 questions