NEW
Font size
S
M
L
XL
WorksheetsPYTHON INTRODUCTION
Total questions: 15
Worksheet time: 3mins
Name
Class
Date
1.
What is an integer constant in Python?
a)
A number with a decimal point
b)
A positive number only
c)
A number without a decimal point
d)
A negative number only
2.
Which of the following is an example of an integer constant?
a)
-10
b)
3.14
c)
"ram"
d)
True
3.
What is a float constant in Python?
a)
A number with a decimal point
b)
A positive number only
c)
A number without a decimal point
d)
A negative number only
4.
Which of the following is an example of a float constant?
a)
100
b)
-5
c)
4.2
d)
Hello
5.
What is a string constant in Python?
a)
A number with a decimal point
b)
A positive number only
c)
A collection of characters enclosed in quotes
d)
A negative number only
6.
What is a Python variable?
a)
A value with a decimal point
b)
A positive number only
c)
A name given to a computer memory location to store a value
d)
A negative number only
7.
What are the naming rules for Python variables?
a)
Variables can begin with any character
b)
Variables cannot contain numbers
c)
Variables cannot contain underscores
d)
Variables must begin with an alphabetic letter or an underscore.
8.
Which of the following is a valid variable name in Python?
a)
my@variable
b)
123abc
c)
_value
d)
2x
9.
Can reserved words (keywords) be used as variable names in Python?
a)
Yes, they can be used as variable names
b)
No, they cannot be used as variable names
10.
Which of the following is an invalid string constant?
a)
'Hello'
b)
"World"
c)
'''Triple quotes can be used for multiline strings.'''
d)
1.5
11.
Which of the following is an example of an integer constant?
a)
'10'
b)
3.14
c)
100
d)
'Python'
12.
Which of the following is an example of a float constant?
a)
-5
b)
'4.2'
c)
2
d)
6.7
13.
Which of the following is an example of a string constant?
a)
10
b)
"Multitek"
c)
-3.14
d)
5.5
14.
Which of the following is an example of a variable?
a)
10
b)
'Hello'
c)
-3.14
d)
x
15.
Which of the following is an invalid variable name?
a)
my_variable
b)
123abc
c)
_value
d)
Xyz
Reset
