wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python test 1

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Who developed Python Programming Language?

a)

Wick van Rossum

b)

Rasmus Lerdorf

c)

Guido van Rossum

d)

Niene Stom

2.

Which of the following is the correct extension of the Python file?

a)

.python

b)

.pl

c)

.py

d)

.p

3.

Is Python code compiled or interpreted?

a)

Python code is both compiled and interpreted

b)

Python code is neither compiled nor interpreted

c)

Python code is only compiled

d)

Python code is only interpreted

4.

What will be the value of the following Python expression?

4 + 3 % 5

a)

7

b)

2

c)

4

d)

1

5.

Which of the following is used to define a block of code in Python language?

a)

Indentation

b)

Key

c)

Brackets

d)

All of the mentioned

6.

In which year was the Python language developed?

a)

1995

b)

1972

c)

1981

d)

1989

7.

Which of the following character is used to give single-line comments in Python?

a)

//

b)

#

c)

!

d)

/*

8.

What will be the output of the following Python code?

i = 1

while True:

if i%3 == 0:

break

print(i)  

i + = 1

a)

123

b)

Error

c)

12

d)

321

9.

What is the order of precedence in python?

a)

Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

b)

Exponential, Parentheses, Division, Multiplication, Addition, Subtraction

c)

Parentheses, Exponential, Multiplication, Addition, Division, Subtraction

d)

Parentheses, Exponential, Multiplication, Division, Addition, Subtraction

10.

Which of the following functions is a built-in function in python?

a)

factorial()

b)

print()

c)

seed()

d)

sqrt()