Font size
WorksheetsPython Topics 1 & 2
Total questions: 14
Worksheet time: 6mins
The str() function converts the specified value into a string.
Yes
No
The int() function converts the specified value into an integer number.
False
True
If the float() function converts the specified value into a floating point number, what is the floating point number for 5?
0.5
5
5.1
3.5
We can compare two values in Python, and will return a:
Int
Boolean Values
Yes or No
We must write the booleans "True or False" in:
Lower Case
Letters
All in Upper Case
The first letter in Upper Case
An example of data convertion is:
converting int data to str.
Implicit Conversion
Explicit Conversion
Which ones use "[...]" in construct data structures:
Sets and dictionaries
Tuples and sets
Lists
Dictionaries
Assignment operators are used to assign values to variables
True
True
x = 5
y = 3
print(x == y)
answer:
They are equal
8
True
False
Logical operator "not" returns (----) if the result is (----)
False
True
A logical answer
What are arithmetic operators? Choose all you believe are correct
Addition
Division
Modulus
Subtraction
If two different variables have the same id() the result will be True.
This meaning is for:
arithmetic
identity (is)
Assignment
logical
The elif keyword is pythons way of saying "if the previous conditions were not true, then try this condition".
True
False
Python has two primitive loop commands, that are:
while loops
for loops
while loops
for loops
