wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Marathon (Easy Round)

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.

Which of the following operators are not allowed in Strings?

a)

+

b)

-

c)

*

d)

==

2.

Give the output of the following code:

a)

ytho

b)

tho

c)

pytho

d)

thon

3.

What will be the output of the following code?

a)

['Guess ', 'he ou', 'pu', ' of ', 'his code']

b)

['Guess t', 'he out', 'put', ' of t', 'his code']

c)

['Guess ', 'the ou', 't pu', 't of ', 'this code']

d)

NameError

4.

Which function can add elements to the end of a list?

a)

.add()

b)

.insert()

c)

.append()

d)

.update()

5.

Which of the following can be an output of the combination of comparison and arithmetic operators?

a)

<int>

b)

<bool>

c)

<float>

d)

All the above

6.

Give the output of the following code:

a)

Rob

b)

Sansa

c)

Bran

d)

Rickon

7.

Which of the following gives the output as False?

a)

print('abc'>'aBc')

b)

print('123334'>'2111')

c)

print('xyz'>'wxyz')

d)

Both a and c

8.

What will be the index of ‘o’ in ‘PythonGeeks’?

a)

 4 or -7

b)

4 or -6

c)

5 or -7

d)

5 or -6

9.

Which of these is not a data type of numbers in Python?

a)

int

b)

float

c)

real

d)

complex

10.

What is the output of the following code?

a)

True

True

b)

True

False

c)

False

Trur

d)

False

False