wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Review Python

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Extension of Python

a)

py

b)

.py

c)

.PYS

d)

.PYE

2.

What is the output of the following code?


var1 = 1

var2 = 2

var3 = "3"


print(var + var2 + var3)

a)

6

b)

33

c)

133

d)

Error. Mixing operators between numbers and strings are not supported

3.

The character used in comments in python is________.

a)

@

b)

#

c)

&

d)

$

4.

Which function is used to accept input from the user during the runtime.

a)

type()

b)

input()

c)

print()

d)

help()

5.

Concatenation is a _________operator.

a)

arithmetic

b)

logical

c)

string

d)

relational

6.

This statement is used to evaluate only one condition

a)

IF STATEMENT

b)

IF -ELSE STATEMENT

c)

IF-ELIF-ELSE STATEMENT

7.

Which of the following data types is not supported in python?

a)

INTEGER

b)

FLOAT

c)

STRING

d)

SLICE

8.

Which one of the following has the highest precedence in the expression?

a)

Addition

b)

Multiplication

c)

Exponential

d)

ParenthesIs

9.

19 % 2 in python

a)

1

b)

2

c)

9

d)

None of these

10.

Which one of these is floor division?

a)

/

b)

//

c)

%

d)

#

11.

Python can work in _____________mode.

a)

1

b)

2

c)

3

d)

4

12.

___________statement are used to assign a value to a variable.

a)

Assignment

b)

String

c)

Logical

d)

Relational

13.

In which language is Python written?

English

a)

English

b)

PHP

c)

C

d)

ALL OF THE ABOVE.

14.

Which of the following statements is correct for variable names in Python language?

a)

All variable names must begin with an underscore.

b)

Unlimited length

c)

The variable name length is a maximum of 2

d)

All of the above

15.

Which of the following operators is the correct option for power(ab)?

a)

a ^ b

b)

a**b

c)

a^^b

d)

a ^ * b