wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Topics 1 & 2

Total questions: 14

Worksheet time: 6mins

Name
Class
Date
1.

The str() function converts the specified value into a string.

a)

Yes

b)

No

2.

The int() function converts the specified value into an integer number.

a)

False

b)

True

3.

If the float() function converts the specified value into a floating point number, what is the floating point number for 5?

a)

0.5

b)

5

c)

5.1

d)

3.5

4.

We can compare two values in Python, and will return a:

a)

Int

b)

Boolean Values

c)

Yes or No

5.

We must write the booleans "True or False" in:

a)

Lower Case

b)

Letters

c)

All in Upper Case

d)

The first letter in Upper Case

6.

An example of data convertion is:

a)

converting int data to str.

b)

Implicit Conversion

c)

Explicit Conversion

7.

Which ones use "[...]" in construct data structures:

a)

Sets and dictionaries

b)

Tuples and sets

c)

Lists

d)

Dictionaries

8.

Assignment operators are used to assign values to variables

a)

True

b)

True

9.

x = 5

y = 3

print(x == y)

answer:

a)

They are equal

b)

8

c)

True

d)

False

10.

Logical operator "not" returns ​ (----)   if the result is ​ (----)  


a)

False

b)

True

c)

A logical answer

11.

What are arithmetic operators? Choose all you believe are correct

a)

Addition

b)

Division

c)

Modulus

d)

Subtraction

12.

If two different variables have the same id() the result will be True.

This meaning is for:

a)

arithmetic

b)

identity (is)

c)

Assignment

d)

logical

13.

The elif keyword is pythons way of saying "if the previous conditions were not true, then try this condition".

a)

True

b)

False

14.

Python has two primitive loop commands, that are:

a)

while loops

for loops

b)

while loops

c)

for loops