Test Your Python Knowledge (1)

Test Your Python Knowledge (1)

Put your Python skills to the test with this quiz covering various topics within the language.

published on August 07
1/10

Which of the following is not a built-in data type in Python?

Lists
Tuples
Dictionaries
Sets
2/10

What keyword is used to define a function in Python?

What keyword is used to define a function in Python?
method
def
func
define
3/10

Which of the following is not a valid Python variable name?

Which of the following is not a valid Python variable name?
2var
_my_var
myVar
my_var
4/10

What is the output of the following code? print('Python'[1:-1])

Py
ytho
thon
yth
5/10

Which module is used for working with regular expressions in Python?

regex
re
reg
regexp
6/10

What does the 'self' keyword refer to in Python class definitions?

The current class instance
The instance itself
The superclass
The subclass
7/10

How do you comment out a single line of code in Python?

/*/ comment */
# comment
// comment
-- comment
8/10

Which of the following is an immutable data type in Python?

List
Tuple
Dictionary
Set
9/10

What is the result of 10 // 3 in Python?

3.333
3
3.0
3.5
10/10

Which method is used to remove an element from a list in Python?

pop()
remove()
delete()
discard()