NEW
Font size
WorksheetsPython Quiz _DAY_2
Total questions: 15
Worksheet time: 35mins
Which of the following is the correct definition of a variable in Python?
A variable is a reserved memory location to store values.
A variable is a fixed value that cannot change.
A variable is a type of function in Python.
A variable is used to perform arithmetic operations
2. What is the value of x after executing x = 5 and then x = 10?
5
10
15
0
3. Which of the following variable names is not valid in Python?
my_var
_myvar
2myvar
myVar2
4.How do you write a single-line comment in Python?
/* This is a comment */
# This is a comment
<!-- This is a comment -->
// This is a comment
5. Which of the following is a correct way to write a multi-line comment in Python?
/* This is a multi-line comment */
''' This is a multi-line comment '''
<!-- This is a multi-line comment -->
# This is a multi-line comment
6. What is a token in Python?
A token is a special type of function.
A token is the smallest unit in a program.
A token is a part of a loop.
A token is a part of a loop.
7. Which of the following is not a type of token in Python?
Keyword
Identifier
Operator
Array
8. How many keywords are there in Python 3.8?
33
35
37
39
9. Which of the following is not a keyword in Python?
True
False
None
define
10. Which of the following is not an arithmetic operator in Python?
+
-
*
==
11. Which of the following operators is used for floor division in Python?
/
%
//
**
12. What will be the result of 5 % 2 in Python?
0
1
2
3
13. Which of the following is a logical operator in Python?
and
*
%
=
14. Which of the following operators is used to compare two values in Python?
=
==
!=
<>
15. Which of the following is a bitwise operator in Python?
and
or
&
not
