wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Unit 2 review

Total questions: 42

Worksheet time: 28mins

Name
Class
Date
1.
The binary digits 0 and 1 are each called a bit.
a)
True
b)
False
2.
The smallest unit for storing data, either a 0 or a 1, is called a byte.
a)
True
b)
False
3.
A bit generally consists of eight bytes.
a)
True
b)
False
4.
A bit is smaller than a byte.
a)
True
b)
False
5.
ASCII is the standard coding method used by personal computers.
a)
True
b)
False
6.

A numbering system that uses ten digits, 0 through 9.

a)

Hexidecimal System

b)

Binary System

c)

Octal System

d)

Decimal System

7.

A numbering system that uses two digits, 0 and 1.

a)

Octal System

b)

Hexadecimal System

c)

Binary System

d)

Decimal System

8.

A group of eight bits joined together.

a)

Octabit

b)

Kilobit

c)

Byte

d)

Encoded Integer

9.

The most common format for text files in computers on the internet where each character is represented by a unique 7-bit binary code.

a)

Unicode

b)

Encoded Text

c)

ASCII

d)

Encoded Integer

10.

Match the following

a)

Formed by eight bits or data.

1.

Byte

b)

Formed by 1000 bytes.

2.

Kilobyte (KB)

c)

Formed by 1,000,000 bytes

3.

Megabyte (MB)

d)

Formed by 1000,000,000 bytes

4.

Gigabyte (GB)

e)

Formed by 1,000,000,000,000 bytes

5.

Terabyte

11.

Match the following Binary to Decimal

a)

00101111

1.

47

b)

10101011

2.

171

c)

10000011

3.

131

d)

11100011

4.

227

e)

01110001

5.

113

12.

Match the following Binary to Decimal

a)

01111000

1.

120

b)

11110010

2.

242

c)

10010010

3.

146

d)

00010010

4.

18

e)

00101110

5.

46

13.

Import means

a)

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

b)

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

c)

To bring reusable code or data into a program from another program or module.

d)

Any data or information entered into a computer.

14.

A file or set of files with related variables, functions, and classes that can be reused in other programs defines

a)

loop

b)

module

c)

comments

d)

expression

15.

A pixel is

a)

a set of instructions written in a language computers can understand.

b)

a single image in a moving sequence for animation, video, or computer graphics.

c)

a value passed to a function

d)

the small dots of color that make up images on a computer screen.

16.

The spelling and grammar rules of a programming language is called

a)

GSP

b)

syntax

c)

code

d)

comments

17.

Variables are

a)

any valid set of values, variables, operators and functions that produce a value or result.

b)

unpredictable sequences of numbers evenly distributed over a certain range.

c)

a sequence of characters, which can include letters, numbers, symbols, punctuation and spacing.

d)

named values that can change.

18.

A string is

a)

A named value that can change.

b)

A sequence of characters, which can include letters, numbers, symbols, punctuation and spacing.

c)

A file or set of files with related variables, functions, and classes that can be reused in other programs.

d)

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

19.

What computer science concept stores information to be used later?

a)

Conditional

b)

Variable

c)

Loop

d)

Function

20.

What data type can hold more than one value?

a)

String

b)

Integer

c)

List

d)

Boolean

21.

What data type would store the value: 6.4?

a)

String

b)

List

c)

Boolean

d)

Float

22.

What data type would store the value: Oranges

a)

String

b)

Float

c)

Boolean

d)

Integer

23.

What data value would store the value: 9?

a)

Float

b)

Integer

c)

String

d)

Boolean

24.

What symbol is used to either add two numbers together or join two strings?

a)

-

b)

=

c)

+

d)

*

25.

What symbol is used to multiply two numbers together?

a)

+

b)

=

c)

*

d)

/

26.

Which of the statements is used to import all names from a module into the current calling module

a)

import

b)

from

c)

dir()

d)

import*

27.

random.randint(3,8)

a)

4,5,6,7

b)

3,4,5,6,7

c)

3,4,5,6,7,8

d)

0,1,2,3,4,5,6,7,8

28.

Which function truncates the fractional part of given number and returns only the integer or whole part.

a)

int()

b)

round()

c)

oct()

d)

hex()

29.

In python which is the correct method to load a module math?

a)

include math

b)

import math

c)

#include<math.h>

d)

using math

30.

In python, what is a function?

a)

Built-in tools, such as print

b)

Text in parentheses

c)

The name of a variable

d)

The result of the code, what is seen when it runs

31.

Info a program receives from a user is:

a)

Input

b)

Output

c)

String

d)

Comment

e)

Error

32.

A series of letters, numbers, or symbols in quotation marks is:

a)

Input

b)

Output

c)

String

d)

Comment

e)

Error

33.

What is it called when you join two strings together with the + symbol?

a)

Assignment

b)

Concatenation

c)

Value

d)

Float

e)

Integer

34.

What is the process for storing a variable? (x = y, for example?)

a)

Assignment

b)

Concatenation

c)

Value

d)

Float

e)

Integer

35.

Match the following

a)

This changes the data type of a value to a string (if applicable)

1.

str

b)

This returns the square root of a value

2.

sqrt

c)

This converts the number to a float (if possible) and returns the absolute float value

3.

fabs

d)

This takes two arguments and returns one to the power of the other

4.

pow

36.

Match the following

a)

This convert real numbers or integers into floating point numbers

1.

float()

b)

This returns the square root of a value

2.

sqrt

c)

This converts the number to a float (if possible) and returns the absolute float value

3.

fabs

d)

This changes the data type of a value to an int (if applicable)

4.

int

37.

Give a number might this code might generate:

import random

random.randint(2,6)

(a)  

38.

Consider the following code:

a= 5

b= 2

a ** b

39.

Match the four basic number operations in programming to their symbol used in python.

a)

addition

1.

+

b)

subtraction

2.

-

c)

multiply

3.

*

d)

divide

4.

/

40.

Modular division returns the remainder of a division problem. To use this in Python, the (a)   symbol is used.

41.

Type in the code that is missing.

import math

num = int(input(" Enter a number: "))

print("The final outcome is: " + (a)   ( math.sqrt(math.fabs(num))) )

42.

Type in the missing code.

_______ ______

x = float(input("Enter a number: "))

y = int(x)

x = x - y

print("The final outcome is: " + str(math.fabs(x)))

(a)