wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Basics

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the output of the following?


a = True

b = False

c = False


if a or (b and c):

print("GEEKSFORGEEKS")

else:

print("geeksforgeeks")

a)

geeksforgeeks

b)

GEEKSFORGEEKS

c)

error

d)

no output

2.

What is the output of the following code :


print(9//2)

a)

4.5

b)

4.0

c)

error

d)

4

3.

Which of these is not a standard data type?

a)

Tuple

b)

Class

c)

Dictionary

d)

List

4.

What data type is the object below ?


L = [1, 23, ‘hello’, 1]

a)

List

b)

Tuple

c)

Dictionary

d)

String

5.

Is Python case sensitive when dealing with identifiers?

a)

Machine Dependent

b)

Yes

c)

No

d)

None of the above

6.

Which of the following is invalid?

a)

_a=1

b)

__a=1

c)

__a__=1

d)

None of the above

7.

In order to store values in terms of key and value we use what core data type.

a)

Dictionary

b)

Tuple

c)

List

d)

None of the above

8.

Which is the correct operator for power?

a)

//

b)

^

c)

**

d)

None of the above

9.

What is the answer to this expression 22 % 3 is?

a)

0

b)

1

c)

5

d)

7

10.

Which of the following is not a keyword?

a)

if

b)

not

c)

global

d)

swap