wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PCEP QUIZ Section 1

Total questions: 40

Worksheet time: 22mins

Name
Class
Date
1.

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

2.

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

3.

A syntax is a part of a langiuage definition which describes the rules used to build:

a)

the sentences from a set of words

b)

the data from digits

c)

the symbols from a set of dots

d)

the words from a set of symbols

4.

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

a)

int()

b)

number()

c)

stringint()

d)

print()

5.

Which of these functions would help print out a random number? 

a)

a) printrandom()

b)

b) number()

c)

c) random.randit()

6.

The (a)   module allows us to use functions that generate random numbers. (No caps)

7.

Which of the following is the correct snippet of code for the function 'find'?

The function 'find' should be given a letter to find and a word to search within.

a)

if char in word:

return True

else:

return False

b)

while True:

find char in word

return True/False

c)

if word has char:

return False

else:

return True

d)

Return True;

Return False;

8.

Which line has an error?

a)

19

b)

21

c)

23

d)

18

9.

How is a try and catch used in python?

a)

It is like an if then else which shows our error if there is one and it does not

b)

It is used to check if a snippet of code has an error and if it does it allows us to handle the error without terminating the program

c)

it tries a snippet of code then it catches the value that it sends, similar as a return

d)

It returns an error and terminates the program so we may identify what was the issue

10.

Which of the following is not a common error in python?

a)

ZeroDivisionError

b)

ValueError

c)

SyntaxError

d)

ListError

11.

An error existing in the code is commonly called as

(a)  

12.

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

13.

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

14.

Python is an example of:

a)

a natural language

b)

a machine language

c)

a high-level programming

d)

an English language

15.

What is a source code?

a)

machine code executed by compilers

b)

another name for a source file

c)

a program written in a high-level programming language

d)

a source of data that gets used in the python file

16.

What python version is covered in this class?

a)

Python3

b)

Python2

c)

Python5

d)

Python

17.

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

18.

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

19.

09. Who created Python?

a)

Guido ban Rossum

b)

Guido van Rossum

c)

Guido the Russian

d)

Guodo van Rossum

20.

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

21.

A complete set of commands is known as:

a)

Instruction list

b)

Code laws

c)

Command-line

d)

Command list

22.

What is the grammar of a programming language?

a)

syntax

b)

indentation

c)

punctuation

d)

program

23.

Why do you need to indent in Python?

a)

To organize lines of code so that they're not messy

b)

To group lines of code together inside a conditional or repeat

c)

To print the answer of the input in the output of the system console

d)

To run the interpreter of the IDE in the debugger of the editor

24.

Which of the following will print 10?

a)

print(7 + 3)

b)

print("6 + 4")

c)

print("5" + "5")

d)

print("0" + 10)

25.

A string does not have to be enclosed with quotation marks.

a)

True

b)

False

26.

Int is the abbreviation used for integers.

a)

True

b)

False

27.

_________________ is a decimal number.

a)

Integer

b)

Variable

c)

String

d)

Float

28.

_________________ is a place holder for value.

a)

varName =

b)

Variable

c)

Integer

d)

Multiplier

29.

Logic errors are the hardest errors to detect.

a)

True

b)

False

30.

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

a)

list

b)

for

c)

while

d)

if

31.

What will be the output?

name = "Dave"

print ("name")

a)

Dave

b)

name

c)

"name"

d)

"Dave"

32.

Choose the correct output of the following code.

for i in range(10,15):       

print(i)

a)

10

11

12

13

14

15

b)

10

11

12

13

14

c)

11

12

13

14

15

d)

11

12

13

14

33.
How many times will Boo print?
a)
none
b)
4
c)
5
d)
1
34.
What will print?
a)
1 2
b)
1
c)
3
d)
5
35.

What term is used to describe data passed into a function?

a)

Variable

b)

Loop

c)

Constant

d)

Parameter

36.

Leo wants to create a function that will roll a dice. Which is the correct function definition header?

a)

def dice roll ():

b)

def diceroll ()

c)

def diceroll ():

d)

def diceroll []:

37.
What will print?
a)
nothing
b)
5
c)
6
d)
an error message
38.

What is an algorithm?

a)

A set of steps for performing a task, like a recipe.

b)

To add something to the end; for example, adding letters onto the end of a string or adding elements to the end of a list or array.

c)

A value passed to a function.

d)

A rhythm designed for people named "Al."

39.

A programming statement that allows a block of code to be repeated for a given range of values defines

a)

function

b)

while loop

c)

for loops

d)

applications

40.

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

a)

applications

b)

algorithms

c)

modules

d)

functions