Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

LS72212 Reviewer

Total questions: 60

Worksheet time: 3600secs

Name
Class
Date
1.

What is the only thing that computers understand?

a)

Machine Code

b)

Low-Level Language

c)

High-Level Language

d)

Algorithms

2.

Which of the following is not a high-level programming language?

a)

Assembly

b)

C++

c)

Java

d)

Python

3.

What is the name for the software used to convert an assembly language program into machine code?

a)

Assembler

b)

Interpreter

c)

Compiler

d)

Translator

4.

Software that translates and executes a high-level language program one line at a time is known as a?

a)

Compiler

b)

Interpreter

c)

Assembler

d)

Executor

5.

Which generation of languages started in the 1950s

a)

First

b)

Second

c)

Third

d)

Fourth

6.

Which generation of computer languages includes SQL (Database Search)?

a)

First

b)

Second

c)

Third

d)

Fourth

7.

Programming languages give computers instructions

a)

True

b)

False

8.

Java, Python, PHP, and C++ are examples of

a)

Low-level languages

b)

Medium-level languages

c)

Graphic arts languages

d)

High-level languages

9.

How many bits makeup one letter in binary code?

a)

4

b)

6

c)

8

d)

10

10.

To focus on the logic and make a refinement to a program before translating it into a programming language, a programmer often creates an outline of the program's algorithm. What is the term for this type of outline?

a)

Pseudocode

b)

Sketch

c)

Compiler

d)

Interpreter

11.

Finding and fixing errors in programs

a)

Tech support

b)

Decompose

c)

Debugging

d)

Fixing

12.

An error in a program that prevents the program from running as expected

a)

Error report

b)

Bug

c)

Mistake

d)

Algorithm

13.

What is the smallest unit of measurement used to quantify computer data?

a)

a bridle

b)

a bit

c)

marble

d)

a tablespoon

14.

What is a high-level programming language that was developed in the mid-1970s? It is now used to write applications for nearly every available platform.

a)

Scratch

b)

Bark-Bark

c)

tynker

d)

C++

15.

Which is the correct definition of Flowcharts

a)

Uses Symbols to show the logical steps to solve the problem

b)

English-like statements of the logic of the program

16.

Which is the correct definition of a Graphical User interface

a)

Part of your computer screen where you type computer instructions

b)

Allows to interact using a graphical environment

17.

Which is not true about the Importance of Programming

a)

To automate the different tasks

b)

To provide intelligent and powerful machines

c)

To provide slower communication

d)

To automate, collect, manage, calculate, and analyze the process data accurately

e)

To create software and applications that help computer and mobile users in daily life.

18.

Select the correct definitions of Sequential Operation

a)

Sequential is a very simple design.

b)

The step where a decision must be made.

c)

It does not involve conditional or iterative processing.

d)

Design in this type is normally from top to bottom or left to right.

19.

Which is true about Conditional Operation

a)

Does not involve conditional or iterative processing.

b)

A more convenient way to handle multiple selections or multiple alternatives.

c)

A step where a decision must be made.

d)

The looping mechanism causes repetition.

20.

The correct definition of Function Call Operation

a)

Loop mechanism

b)

A convenient way to handle multiple selections

c)

Ask questions and choose an action based on the available options

d)

Depicts a sub-process or sub-routine

21.

What is the best way to think about a "Syntax Error" while programming?

a)

The computer has used to find your location and hates everyone from your town

b)

The computer is overheating and just wants you to stop to let it cool down

c)

The computer needs to have its software upgraded

d)

The computer did not understand the statement that you entered

22.

What will the following program print out:

>>> x = 15

>>> x = x + 5

>>> print (x)

a)

"print x"

b)

15

c)

5

d)

20

e)

x + 5

23.

Python scripts (files) have means that end with:

a)

.png

b)

.doc

c)

.exe

d)

.py

24.

Which of these words are reserved words in Python?

a)

machine

b)

if

c)

break

d)

todo

e)

while

25.

What is the proper way to say "Goodbye" to Python?

a)

//stop

b)

quit()

26.

Which of the parts of a computer actually executes the program instructions?

a)

Input/Output Devices

b)

Secondary Memory

c)

Main Memory

d)

Central Processing Unit (CPU)

27.

A USB memory stick is an example of one of the following components of computer architecture.

a)

Output Device

b)

Main Memory

c)

Central Processing Unit

d)

Secondary Memory

28.

In the following code,

>>> print (98.6)

What is 98.6?

a)

A conditional statement

b)

An interation/loop statement

c)

A constant

d)

A variable

29.

Which of the following is a comment in Python?

a)

/* This is a test */

b)

This is a test

c)

#This is a test

d)

//This is a test

30.

What does the following code print out?

>>> print("123" + "abc")

a)

123+abc

b)

123abc

c)

This is a syntax error because you cannot add strings.

d)

hello world

31.

In the following code,

>>> x = 42

What is "x"?

a)

A constant

b)

A function

c)

A variable

d)

A constant Processing Unit

32.

Which of the following is not a python reserved word?

a)

for

b)

if

c)

else

d)

speed

33.

Assume the variable x has been initialized to an integer value (e.g., x = 3). What does the following statement do?

>>> x = x + 2

a)

Produce the value "false" because "x" can never equal "x+2"

b)

Retrieve the current value for x, add two to it and put the sum back into x

c)

This would fail as it is a syntax error

d)

Create a function called "x" and put the value 2 in the function

34.

What is the value of the following expression

>>> 42 % 10

Hint - the "%" is the remainder operator

a)

2

b)

10

c)

420

d)

1042

35.

What will be the value of x after the following statement executes:

>>> x = 1 + 2 * 3 - 8 / 4

a)

3.0

b)

4

c)

5.0

d)

15

36.

What will be the value of x when the following statement is executed:

>>> x = int (98.6)

a)

99

b)

100

c)

98

d)

6

37.

What do we do to a Python statement that is immediately after an if statement to indicate that the statement is to be executed only when the if statement is true?

a)

Underline all of the conditional code

b)

Start the statement with a "#" character

c)

Indent the line below the if statement

d)

Begin the statement with a curly brace {

38.

Which of these operators is not a comparison / logical operator?

a)

>=

b)

>

c)

!=

d)

==

e)

=

39.

What is true about the following code segment:

>>> if x == 5 :

>>> print('Is 5')

>>> print('Is Still 5')

>>> print('Third 5')

a)

Only two of the three print statements will print out if the value of x is less than zero.

b)

The string 'Is 5' will never print out regardless of the value for x.

c)

Depending on the value of x, either all three of the print statements will execute or none of the statements will execute

d)

The string 'Is 5' will always print out regardless of the value for x.

40.

When you have multiple lines in an if block, how do you indicate the end of the if block?

a)

You use a curly brace { after the last line of the if block

b)

You capitalize the first letter of the line following the end of the if block

c)

You de-indent the next line past the if block to the same level of indent as the original if statement

d)

You omit the semicolon ; on the last line of the if block

41.

What is the Python reserved word that we use in two-way if tests to indicate the block of code that is to be executed if the logical test is false?

a)

else

b)

iterate

c)

otherwise

d)

A closing curly brace followed by an open curly brace like this }{

42.

What will the following code print out?

>>> x = 0

>>> if x < 2 :

>>> print('Small')

>>> elif x < 10 :

>>> print('Medium')

>>> else :

>>> print('LARGE')

>>> print('All done')

a)

Small

b)

Medium All done

c)

Small All done

d)

Small Medium LARGE All done

43.

For the following code,

>>> if x < 2 :

>>> print('Below 2')

>>> elif x >= 2 :

>>> print('Two or more')

>>> else :

>>> print('Something else')

What value of 'x' will cause 'Something else' to print out?

a)

x = -2

b)

x = 2.0

c)

This code will never print 'Something else' regardless of the value for 'x'

d)

x = 2

44.

In the following code (numbers added) - which will be the last line to execute successfully?

(1) astr = 'Hello Bob'

(2) istr = int(astr)

(3) print('First', istr)

(4) astr = '123'

(5) istr = int(astr)

(6) print('Second', istr)

a)

2

b)

6

c)

1

d)

3

45.

For the following code:

>>> astr = 'Hello Bob'

>>> istr = 0

>>> try:

>>> istr = int(astr)

>>> except:

>>> istr = -1

What will the value be for istr after this code executes?

a)

It will be the 'Not a number' value (i.e. NaN)

b)

0

c)

-1

d)

The istr variable will not have a value

46.

Which Python keyword indicates the start of a function definition?

a)

help

b)

sweet

c)

def

d)

break

47.

In Python, how do you indicate the end of the block of code that makes up the function?

a)

You put a

b)

You add the matching curly brace that was used to start the function

c)

You de-indent a line of code to the same indent level as the def keyword

d)

You put the "END" keyword in column 7 of the line which is to be the last line of the function

48.

In Python what is the input() feature best described as?

a)

A user-defined function

b)

A built-in function

c)

A conditional statement

d)

The central processing unit

49.

What does the following code print out?

>>> def thing():

>>> print('Hello')  

>>> print('There')

a)

There

b)

defthing

c)

thingHelloThere

d)

Hello

50.

In the following Python code, which of the following is an "argument" to a function?

>>> x = 'banana'

>>> y = max(x)

>>>print(y)

a)

print

b)

'banana'

c)

max

d)

x

51.

What will the following Python code print out?

>>> def func(x) :

>>> print(x)  

>>> func(10)

>>> func(20)

a)

x20

b)

funcfunc

c)

10

20

d)

x10

x20

52.

What is the most important benefit of writing your own functions?

a)

To avoid having more than 10 lines of sequential code without an indent or de-indent

b)

Following the rule that whenever a program is more than 10 lines you must use a function

c)

Avoiding writing the same non-trivial code more than once in your program

d)

Following the rule that no function can have more than 10 statements in it

53.

What is wrong with this Python loop:

>>> n = 5

>>> while n > 0 :

>>> print(n)

>>> print('All done')

a)

There should be no colon on the while statement

b)

while is not a Python reserved word

c)

The print('All done') statement should be indented four spaces

d)

This loop will run forever

54.

What does the break statement do?

a)

Jumps to the "top" of the loop and starts the next iteration

b)

Exits the currently executing loop

c)

Exits the program

d)

Resets the iteration variable to its initial value

55.

What does the continue statement do?

a)

Exits the program

b)

Resets the iteration variable to its initial value

c)

Exits the currently executing loop

d)

Jumps to the "top" of the loop and starts the next iteration

56.

What does the following Python program print out?

>>> tot = 0

>>> for i in [5, 4, 3, 2, 1] :

>>> tot = tot + 1

>>> print(tot)

a)

15

b)

10

c)

0

d)

5

57.

What is the iteration variable in the following Python code:

>>> friends = ['Joseph', 'Glenn', 'Sally']

>>> for friend in friends :

>>> print('Happy New Year:', friend)

>>>print('Done!')

a)

Glenn

b)

Joseph

c)

Sally

d)

friend

58.

What is a good description of the following bit of Python code?

>>> zork = 0

>>> for thing in [9, 41, 12, 3, 74, 15] :

>>> zork = zork + thing

>>> print('After', zork)

a)

Compute the average of the elements in a list

b)

Find the smallest item in a list

c)

Count all of the elements in a list

d)

Sum all the elements of a list

59.

What will the following code print out?

>>> smallest_so_far = -1

>>> for the_num in [9, 41, 12, 3, 74, 15] :

>>> if the_num < smallest_so_far :

>>> smallest_so_far = the_num

>>> print(smallest_so_far)

Hint: This is a trick question and most would say this code has a bug - so read carefully

a)

42

b)

3

c)

74

d)

-1

60.

Which reserved word indicates the start of an "indefinite" loop in Python?

a)

while

b)

break

c)

for

d)

def

e)

indef