Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PCEP Evaluation

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

Which of the following is incorrect for a dictionary in Python?

a)

each key must be unique

b)

the key should be an immutable object

c)

the len() function returns the sum of key-value elements in the dictionary

d)

the len() function returns the numbers of key-value elements in the dictionary

2.

A complete set of commands is known as:

a)

Instruction list

b)

Code laws

c)

Command-line

d)

Command list

3.

Which of the following are correct statements?

a)

True + 1 evaluates to 1

b)

True and False evaluates to False

c)

True or False evaluates to False

d)

7+ False evaluates to False

4.

Octal has the following base:

a)

2

b)

8

c)

10

d)

16

5.

If a list passed into function’s argument and modified inside the function:

a)

Will affect the argument

b)

Will not affect the argument

c)

Will give an error

d)

Will become global by default

6.

An integer number preceded by an 0x (Zero-x) will be treated as:

a)

Octal

b)

Binary

c)

Hexadecimal

d)

Decimal

7.

09. Who created Python?

a)

Guido ban Rossum

b)

Guido van Rossum

c)

Guido the Russian

d)

Guodo van Rossum

8.

The meaning of positional parameter is determined by:

a)

Position

b)

Name

c)

Style

d)

None

9.

The following expression : 2 ** 3 ** 2 ** 1

a)

invalid

b)

equal to 16

c)

equal to 16.0

d)

equal to 512

10.

What would you insert instead of ??? so that the program prints 1024 to the monitor?

a)

[0]

b)

[1]

c)

[-1]

d)

[1024]

11.

What is the expected output of the following snippet?

a)

0

b)

3

c)

7

d)

11

e)

The program will cause a runtime exception

12.

What is the expected output of the following snippet?

a)

[2,4]

b)

['C',2,4]

c)

['B','C',2,4]

d)

['A','B']

13.

If the following snippet is executed and the exception is raised

a)

two identical non-empty lines

b)

two different non-empty lines

c)

two empty lines

d)

one non-empty line and one empty line

14.

What is the expected behavior of the following snippet?

a)

print hello

b)

print h

c)

print ello

d)

cause a runtime exception on line 5

15.

What is the expected output of the following snippet?

a)

True

b)

False

c)

None

d)

The program will cause a runtime exception/error

16.

How many lines does each of the following code examples output when run separately?

a)

Example 1: two, Example 2: one, Example 3: one, Example 4: one

b)

Example 1: two, Example 2: one, Example 3: one, Example 4: two

c)

Example 1: two, Example 2: one, Example 3: two, Example 4: three

d)

Example 1: one, Example 2: one, Example 3: one, Example 4: two

17.

What is the expected behavior of the following snippet?

a)

print 5

b)

print 8

c)

print 3

d)

code will run into an error

18.

A process in which the source code is immediately executed without translating in into a machine code is called:

a)

complilation

b)

linking

c)

interpretation

d)

debugging

19.

A code written in a high-level programming language is called:

a)

a binary code

b)

the ASCII code

c)

a source code

d)

machine code

20.

Which of these would assist in making a string an integer? 

a)

int()

b)

number()

c)

stringint()

d)

print()

21.

What is IDLE?

a)

An acronym that stands for Integrated Development and Learning Environment for python

b)

A version of Python

c)

An acronym that stands for Interactive Development and Learning Extension

d)

An acronym that stands for Individual Development Language Exclusive

22.

What do you call a tool that lets you launch your code step-by-step and inspect it at each moment of execution?

a)

A console

b)

A debugger

c)

An editor

d)

A notepad

23.

What is the grammar of a programming language?

a)

syntax

b)

indentation

c)

punctuation

d)

program

24.

Kind of loop used when you know the number of times you want it to repeat

a)

list

b)

for

c)

while

d)

if

25.

A named, reusable set of programming statements to perform a specific task defines

a)

applications

b)

algorithms

c)

modules

d)

functions