wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Computer Engineering - Python Exam

Total questions: 18

Worksheet time: 49mins

Name
Class
Date
1.

Type your full name

4 lines
2.

Type your grade and section (12AG or 12BG)

4 lines
3.

A (a)   contains keys and values enclosed with curly braces { }.

4.

A (a)   is items separated by commas enclosed with parenthesis ( ),

once created it cannot be updated.

5.

A (a)   is items separated by commas enclosed with square brackets [ ], it can contain different types of data.

6.

Which of the following is an invalid variable?

a)

result_var_4

b)

2nd_result

c)

var

d)

__var

7.

Python enables concatenation of strings so you can add a string with string

or a variable.

a)

True

b)

False

8.

Variables are nothing but

a)

reserved memory location to store values

b)

algorithms

c)

concatenation of strings

d)

exponentiation

9.

And, Or, Not are examples of

a)

Logical operators

b)

Bitwise operators

c)

Membership operators

d)

Identity operators

10.

What is the output of the following code

a=8

b=8

c=16

a/2 is c/4

a)

True

b)

False

11.

In an If else statement, if the condition is evaluated to true, the

statement(s) of the if block will be executed, otherwise the statement(s) in else block will be executed.

a)

True

b)

False

12.

<, >, <=, >= are examples of

a)

Logical Operators

b)

Comparison operators

c)

Identity Operators

d)

Arithmetic operators

13.

+, -, *, / are examples of

a)

Logical Operators

b)

Comparison operators

c)

Identity Operators

d)

Arithmetic operators

14.

Divides the left-hand operand by the right-hand operand and

returns the remainder.

a)

Floor Division

b)

Division

c)

Modulus

d)

Exponential

15.

Is the division of operands where the result is the

quotient with the digits after the decimal point removed.

a)

Floor Division

b)

Division

c)

Modulus

d)

Exponential

16.

State four features of Python.

4 lines
17.

State 4 applications of Python.

4 lines
18.

 

What is the output of the below code?

numbers = [10, 20]

items = ["Chair", "Table"]

print (numbers + items)

print (items * 2)

a)

[10, 20, 'Chair', 'Table']

['Chair', 'Table', 'Chair', 'Table']

b)

[10, 20, 'Chair', 'Table']

[‘Chair’, ‘Table’, 2]

c)

[30, ‘Chair Table’]

['Chair', 'Table', 'Chair', 'Table']