wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CS: Python Unit 1 Review

Total questions: 57

Worksheet time: 29mins

Name
Class
Date
1.
Input devices allow us to send information to the CPU (Central Processing Unit) to tell the computer what to do.
a)
True
b)
False
2.
Output devices receive information from the CPU (Central Processing Unit), then translate it into sounds or images that we can understand.
a)
True
b)
False
3.
Which of these is not an input device?
a)
Scanner
b)
Screen
c)
Microphone
d)
Keyboard
4.
What is the purpose of an operating system?
a)
Manage software on computer
b)
Manage hardware on computer
c)
Manage all hardware & software on computer
5.
What does the print function do in python?
a)
It's a variable.
b)
It can input data.
c)
It displays something like a string or integer
d)
It loops the code.
6.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
7.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
8.
What syntax can you use to insert a line break between strings so that they appear over multiple lines?
a)
/
b)
\n
c)
\l
d)
n
9.
What does CPU stand for?
a)
Control Processing Unit
b)
Central Processing Unit
c)
Central Power Unit
d)
Center Power Unit
10.

It is any electronic or mechanical part you can see or touch:

a)

Peripherals

b)

Hardware

c)

Main memory

11.

It is a set of instructions , called a program:

a)

Disk drives

b)

Central Processing Unit

c)

Software

12.

Three basic hardware sections are:

a)

Monitor, printer and mouse

b)

CPU, main memory and peripherals

c)

Ports, keyboard, software

13.

It holds the instructions and data which are being processed by the CPU:

a)

Port

b)

Main memory

c)

Keyboard

14.

Its function is to execute program instructions and coordinate the activities of all the other units:

a)

Printer

b)

Ports

c)

CPU

15.
What is a variable?
a)
The set of rules governing the order in which expressions involving multiple operators and operands are evaluated.
b)
A name that refers to a value.
c)
A category of values. The types we have seen so far are integers (type int), floating-point numbers (type float), and strings (type str).
d)
One of the basic units of data, like a number or string, that a program manipulates.
16.

What rule is the following variable name BREAKING:


1st_Name

a)

No special characters other than underscore

b)

Only use text for the start of the variable name - no numbers at start

c)

Keep names meaningful

d)

There is nothing wrong with this variable name

17.

Pick the Python command used to let the user type in some data

a)

get

b)

input

c)

int

d)

float

18.

Which of the following is a Python command word used to indicate we want to work with WHOLE numbers

a)

input

b)

int

c)

float

d)

print

19.

Which of the following is a Python command word used to indicate we want to work with DECIMAL numbers

a)

input

b)

int

c)

float

d)

print

20.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
21.

Why do we put a string of text inside the brackets of an input?

a)

The input function can also be used as an output, but only one string at a time.

b)

The input function can also be used as an output, with several strings at a time.

c)

The string of text can be used to instruct the user as to what they must type in.

d)

The string of text is required, to act as a wrapper for the input the user types in; otherwise the data will be invalid string data and go nowhere.

22.
What will the output be from the following code?
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
23.
Joining elements together to make a string is called what?
a)
Combining
b)
Connecting
c)
Concatenation
d)
Stringing
24.
Converts a number to a string
a)
str()
b)
int()
c)
parseInt()
d)
convert
25.

Which types of quotes may enclose a string?

a)

A) Simple single quote: ' '

b)

B Any quote will work so long as you are consistent

c)

C) Simple double quote: " "

d)

Both A and C

26.

How do you get information from a user using your program?

a)

input("Enter your name: ")

b)

name = imput("Enter yur name: ")

c)

name = input("Enter your name: ")

d)

imput("Enter your name: ")

27.

What are good rules for creating variable names?

a)

Use camelCase consistently

b)

Use meaningful names

c)

Avoid very long names

d)

All of the above

28.

Which of the following codes is correct?

a)

("Good Morning. Who are you?​"​)​ = name

print ("Hi there ​" + ​name​ + "​, nice to meet you")

b)

name = ​input ("Good Morning. Who are you?​"​)​

print ("Hi there ​" + ​name​ + "​, nice to meet you")

c)

name = ​input ("Good Morning. Who are you?​"​)

print ("Hi there ​" ​name​ "​, nice to meet you")

d)

("Good Morning. Who are you?​"​)​ = name

print ("Hi there ​" name​ "​, nice to meet you")

29.

Long-term memory used by the computer

a)

Main memory

b)

Output

c)

Input

d)

Secondary Memory

30.

____________ are special output characters marked with a \.

a)

Strings

b)

Output

c)

Escape Characters

d)

Echo Characters

31.
Data and information in the real world.
a)
analog
b)
binary
c)
digital
d)
program
e)
escape characters
32.
A number system based on two.
a)
binary
b)
analog
c)
digital
d)
program
e)
CPU
33.
Translates code to machine language.
a)
compiler
b)
comment
c)
variable
d)
main memory
e)
program
34.
An electronic device consisting of hardware and software.
a)
computer
b)
comment
c)
output
d)
compiler
e)
hardware
35.
Using technology to solve human problems.
a)
Computer Science
b)
compiler
c)
main memory
d)
computer
e)
program
36.
A number system based on ten, the number system we normally use.
a)
decimal
b)
binary
c)
analog
d)
digital
e)
software
37.
Numeric data stored in a computing device.
a)
digital
b)
analog
c)
binary
d)
decimal
e)
escape characters
38.
The user sends information to the computer.
a)
input
b)
comment
c)
compiler
d)
program
e)
software
39.

Function that translates Strings to integer numbers.

a)

int

b)

integer

c)

Str

d)

String

e)

str

40.

Short term memory; temporary; power off = all information is lost.

a)

main memory

b)

secondary memory

c)

compiler

d)

software

e)

CPU

41.
Translates digital information to information humans can use.
a)
output
b)
compiler
c)
variable
d)
program
e)
hardware
42.
Command displays text and numbers on the screen.
a)
print
b)
output
c)
compiler
d)
String
e)
escape characters
43.
Instructions that a computer follows, written in code.
a)
program
b)
secondary memory
c)
main memory
d)
variable
e)
CPU
44.
Long term memory; storage.
a)
secondary memory
b)
output
c)
compiler
d)
main memory
e)
software
45.
Programs that run on hardware.
a)
software
b)
secondary memory
c)
main memory
d)
variable
e)
hardware
46.

Lets the user type in letters, numbers and words. Not used for calculations.

a)

String

b)

Str

c)

str

d)

int

e)

integer

47.
A name for a spot in the computer's memory.
a)
variable
b)
comment
c)
main memory
d)
String
e)
secondary memory
48.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
49.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
50.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
51.
What will the output be from the following code?
print("Hello" + "world!")
a)
Hello world!
b)
Helloworld!
c)
SyntaxError
d)
"Hello" "world!"
52.
What will the output be from the following code?
print("Hello" + 2 + "world")
a)
Hello 2 world
b)
Hello2world
c)
TypeError
d)
HelloHelloworld
53.
What will the output be from the following code?
print("Hello" + str(2) + "world!")
a)
Hello world! Hello world!
b)
Hello2world!
c)
Hello Hello world! world!
d)
SyntaxError
54.

What is the output of this program?


number1 = 67

number2 = 3

number 3 = 0


result = number1 + number2 + number3


print(result)

a)

70

b)

700

c)

67

d)

3

55.

What is the type of this value?

57

a)

int

b)

str

c)

float

d)

type

56.

What is the type of this value?

57.5

a)

int

b)

str

c)

float

d)

type

57.

What is the type of this value?

"57.5"

a)

int

b)

str

c)

float

d)

type