WorksheetsPythonDataTypes
Total questions: 20
Worksheet time: 13mins
What is a String?
A data type that contains whole numbers. eg: 3, 45, 124
Numbers with decimal point. eg: 0.5, 2.45, 56.04
Group of characters between quotation marks. eg: "dog"
Data type that can only be True or False.
A variable is a named value that can be changed in the program.
False
True
Which writes a message for the user?
input()
myVar="Hi"
print("Hello!")
max=100
Below are the valid data types in Python EXCEPT
int
float
char
decimel
Which if the values below return TRUE if executed?
10 > 3
10 < 3
10 >< 3
10 <> 3
Which variable uses a integer data type?
password
passwordScore
passwordLength
What is the content of variable c after the following Python code is executed?
a = 34
b = 0.56 - 7.5j
c = a + b
34.56
34.56 - 7.5j
27.06
Error message
What is the output of the following Python code?
a = 13.5
b = -24.6
a, b = b, a
print(a, b)
13.5 -24.6
-24.6 13.5
-13.5 24.6
13.5 24.6
What will be the output from the following Python code?
print("3+4")
7
3+4
34
SyntaxError
Python is _____ sensitive which means you must use the same indentation every time.
space
colour
code
word
What is the output for this line of code: print(type(8))
<class 'bool'>
<class 'str'>
<class 'int'>
<class 'float'>
What is the output for this line of code: print(type('I love Quizizz!"))
<class 'bool'>
<class 'str'>
<class 'int'>
error
Which of the following is invalid variable?
_a = 1
__a = 1
__str__ = 1
none of the mentioned
The expression Int(x) implies that the variable x is converted to integer.
True
False
Is Python case sensitive when dealing with identifiers?
yes
No
Machine Dependent
None of the mentioned
The expression int(x) implies that the variable x is converted to integer. State whether true or false.
True
False
What is the maximum possible length of an identifier?
31 characters
63 characters
79 characters
unlimited in length
Mathematical operations can be performed on a string. State whether true or false.
True
False
What do you think about our training progress for today?
Too fast
Just about right
Too slow
