wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Quiz 2

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

When you compare two values, the expression is evaluated and Python returns a Boolean answer.

a)

True

b)

False

2.

When you run a condition in an if statement, Python returns True or False.

a)

True

b)

False

3.

thislist = ["apple", "banana", "cherry"] , print(thislist)

a)

None of these are the compilers response

b)

a, b, c

c)

apple, banana, cherry

d)

['apple', 'banana', 'cherry']

4.

Define zip()

a)

None of these

b)

Returns an iterator, from two or more iterators

c)

Returns an application title, from two or more iterators, and lists alphabetically.

d)

Returns an apoapsis, from two or more sats.

5.

Define vars()

a)

Returns the __dict__ property of an object

b)

None of these

c)

Returns variables within a method.

d)

Returns the count of text within one or more variabels.

6.

Define type()

a)

All of these

b)

Returns the type of an object.

c)

Returns the type of an instance after manipulated object POSTED.

7.

tuple() method returns a tuple aka storing multiple items in a single variable

a)

True

b)

False

8.

Define range()

a)

Returns a sequence of numbers, starting from 8 and increments by 3 (by default)

b)

Returns a sequence of numbers, starting from 0 and increments by 1 (by default)

c)

Returns a sequence of numbers, starting from 1 and increments by 4 (by default)

d)

Returns a sequence of numbers, starting from 1 and increments by 1 (by default)

9.

Returns True if the specified object has the specified attribute (property/method)

a)

hasattr()

b)

hasabs()

c)

hasmethod()

d)

hasprop()

10.

Returns the quotient and the remainder when argument1 is divided by argument2

a)

modsiv()

b)

dividemod()

c)

divmodulus()

d)

divmod()