wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AP CSP EOS Exam Practice

Total questions: 87

Worksheet time: 46mins

Name
Class
Date
1.

A work or invention that is the result of creativity, such as a piece of writing or a design, to which one has rights and for which one may apply for a patent, copyright, trademark, etc.

a)

Creative Commons

b)

Digital Data

c)

Intellectual Property

d)

Sampling

2.

A contraction of "Binary Digit"; the single unit of information in a computer, typically represented as a 0 or 1

a)

Digital Data

b)

Byte

c)

Binary

d)

Bit

3.

A process for reducing the number of bits needed to represent something without losing any information. This process is reversible.

a)

Lossless Compression

b)

Sampling

c)

Lossy Compression

d)

Overflow Error

4.

Error from attempting to represent a number that is too large.

a)

Round-off Error

b)

Sampling

c)

Overflow Error

d)

Analog Data

5.

A way of representing information using only two options.

a)

Byte

b)

Binary

c)

Bit

d)

Lossy Compression

6.

Data with values that change continuously, or smoothly, over time. Some examples include music, colors of a painting, or position of a sprinter during a race.

a)

Digital Data

b)

Lossy Compression

c)

Byte

d)

Analog Data

7.

Data that changes discretely through a finite set of possible values

a)

Digital Data

b)

Analog Data

c)

Sampling

d)

Lossless Compression

8.

A collection of public copyright licenses that enable the free distribution of an otherwise copyrighted work, used when an author wants to give people the right to share, use, and build upon a work that they have created

a)

Intellectual Property

b)

Sampling

c)

Digital Data

d)

Creative Commons

9.

Error from attempting to represent a number that is too precise.

a)

Round-off Error

b)

Overflow Error

c)

Analog Data

d)

Lossless Compression

10.

8 bits

a)

Binary

b)

Digital Data

c)

Byte

d)

Analog Data

11.

What Python command lets the user enter an answer to a question?

a)

answer()

b)

open()

c)

print()

d)

input()

12.

What is Python named after?

a)

 The television show Monty Python's Flying Circus 

b)

A Snake

c)

The name of the guy who created it, "Guido Python"

d)

The snake game, "Python".

13.

What Python command is used to output text to the screen?

a)

input()

b)

print()

c)

int()

d)

display()

14.

What is the purpose of comment lines in code?

a)

To compliment your work so you feel better about it.

b)

To explain the code that follows it.

c)

To make the code compile.

d)

To make your code longer so you get more points.

15.

Which symbol is used to make a comment line in Python?

a)

&

b)

//

c)

#

d)

'

16.

Which is the correct way to declare and initialize a variable in Python?

a)

my_variable: 10

b)

my_variable == 10

c)

my_variable = 10

d)

my_variable is 10

17.

A data type consisting of letters, numbers and symbols enclosed in quotation marks.

a)

integer

b)

float

c)

string

d)

boolean

18.

A data type consisting of numbers with decimals.

a)

integer

b)

float

c)

string

d)

boolean

19.

Code that decides whether or not to skip a section of code.

a)

Conditional

b)

For Loop

c)

While Loop

d)

Then Block

20.

What will be the output from the following code?
print("Hello" + "World")

a)

Hello, World

b)

"Hello" + "World"

c)

Hello World

d)

HelloWorld

21.

What will be the output from the following code?
print(17%5)

a)

3

b)

3.4

c)

2

d)

12

22.

What is the assignment operator?

a)

+=

b)

=

c)

->

d)

==

23.

What is the increment operator

a)

+=

b)

-=

c)

==

d)

=

24.

Which symbol means "not equal"?

a)

>=

b)

!=

c)

==

d)

+=

25.

Which statement correctly assigns the string "Tanner" to the variable name?

a)

name  = print( "Tanner")

b)

input("Tanner")

c)

name = "Tanner"

d)

name = input("Tanner")

26.

What will be the output of this code?
x = 13

y = 14

if x!=y:

print("Hello")

else:

print("Hi")

a)

Hello

b)

Hi

c)

14

d)

13

27.

Which of the following is NOT possible using the RANDOM(a, b) and DISPLAY(expression) abstractions?

DISPLAY(RANDOM(0, 4) + RANDOM(2, 8)

a)

13

b)

5

c)

7

d)

9

28.

Order the following programming languages from low-level language to high-level language.

COBOL
Python
Machine code

a)

Machine code, COBOL, and Python

b)

Machine code, Python, and COBOL

c)

COBOL, machine code, and Python

d)

Python, COBOL, and machine code

29.

A while loop can be used in which of the following situations?

a)

Repeat a set of statements till a condition remains True.

b)

Repeat a set of statements a finite or an infinite number of times.

c)

Iterate through a string, list, and tuple.

d)

All of the above

30.

What is a variable?

a)

a type of graphics

b)

A box(memory location) where you store values

c)

Data type

d)

a type of memory

31.

A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly

a)

True

b)

False

32.

How do you identify the statements that belong to the body of a function?

a)

Indent those statement the same amount underneath the function "def" statement

b)

Add opening and closing curly braces { and } to mark the start and stop of the function body

c)

Add the "def" keyword to the beginning of each statement

d)

Add the same comment (#) to the right of each statement within the body

33.

What character should be placed at the end of the function "def" line, after the parentheses?

a)

Hashtag (#)

b)

Colon(:)

c)

Exclamation (!)

d)

Dash (-)

34.

Which of the following best describes where you should define your function in your code?

a)

Near the bottom of the source file, after that function is called by any main program code

b)

Always place functions in a separate source file

c)

Near the top of the source file, before that function is called by any main program code

d)

The location is not important, so place the function wherever you like

35.

23 == 32

a)

True

b)

False

36.

4 == 4.0

a)

True

b)

False

c)

Error

37.

What is an example of a boolean?

a)

"Hello!"

b)

56

c)

True/False

d)

46.7

38.

What is the purpose of a loop in programming?

a)

The purpose of a loop in programming is to repeat a block of code.

b)

The purpose of a loop in programming is to randomly select a block of code.

c)

The purpose of a loop in programming is to skip a block of code.

d)

The purpose of a loop in programming is to execute code only once.

39.

What is the purpose of import random in Python?

a)

To send emails

b)

To get random numbers

c)

To store data in a file

d)

To create websites

40.

What does random.randint(1, 10) do?

a)

Picks any number

b)

Picks a decimal between 1 and 10

c)

Picks a random number from 1 to 10 (inclusive)

d)

Picks only 10

41.

To make the turtle move forward, which command is used?

a)

turtle.penup()

b)

turtle.forward()

c)

turtle.left()

d)

turtle.backward()

42.

In order to move the turtle 120 forward without drawing on the screen, which order is correct?

a)

turtle.forward(120)

turtle.penup()

turtle.pendown()

b)

turtle.pendown()

turtle.forward(120)

turtle.penup()

c)

turtle.penup()

turtle.forward(120)

turtle.pendown()

43.

Which of these commands would create a turtle named Alice?

a)

Alice = turtle.pen()

b)

Alice = Turtle.pen()

c)

Alice = Turtle.turtle()

d)

Alice = turtle.Turtle()

44.

How many times will this code loop?

a)

50

b)

90

c)

0

d)

4

45.

Look at this code, what shape will it make?

a)

Square

b)

Triangle

c)

Rectangle

d)

Hexagon 

46.

To move the turtle to a specific position on the drawing canvas you need to use which of the following commands?

a)

set_pos( )

b)

setpos( ):

c)

setpos

d)

setposition( )

47.

How do you tell that Python that you are going to use the turtle library?

a)

import turtle

b)

turtle import

c)

from turtle import *

d)

from turtle import

48.

What do you put at the end of a turtle program?

a)

import turtle

b)

wn.mainloop()

c)

hunter = turtle.Turtle()

d)

wn = turtle.Screen()

49.

What is the keyword needed to repeat code (iterate) in Python?

a)

for

b)

if

c)

input

d)

print

50.

What does this code do?


hunter.color("yellow")

hunter.begin_fill()

hunter.circle(100)

hunter.end_fill()

a)

Makes a yellow-filled circle

b)

Makes a yellow circle that is not filled in

c)

Makes a black circle that is not filled in

d)

Makes a white (invisible) circle

51.

Why are comments important in programming?

a)

Comments are ignored by the compiler while running the code.

b)

Lazy programmers (who do not comment the code properly) forget their own implemented logics and waste much more time solving the issue when they see their code later.

c)

In Python we can write a single line comment by using #.

d)

Comments are helpful to other programmers to understand the code better. They can easily understand the logic behind solving any problem.

52.

What is a library in coding?

a)

Place to store the code you have written

b)

Collection of code from outside of the program

c)

Location to find books to help you learn coding

d)

The list of examples for coding

53.

What is the random library used for?

a)

Used to find errors in your code

b)

Used to add sound to your code

c)

Used to add graphics to your code

d)

Used to add randomness to your code

54.

Which is the correct statement to use the random library in your program?

a)

import random

b)

random import

c)

random.randint( )

d)

random = import

55.

What is a function?

a)

an action within your code, print and input are examples of functions

b)

an action defined in one location but used somewhere else in your code, print and input are examples of functions

56.

Pieces of information that you need to give a function in order for it to run.

a)

Data

b)

Function

c)

Argument

d)

Editor

57.

Which is the correct syntax for keying a Boolean?

a)

has_dog = true

b)

has_dog = "true"

c)

has_dog = True

d)

has_dog = TRUE

58.

What best defines an IF statement in Python?

a)

An embedded string with a variable

b)

Checks to see if a statement is true or false and then does one of two things depending on the result.

59.

In programming, what is iteration?

a)

The repetition of steps within a program

b)

A decision point in a program

c)

The order in which instructions are carried out

d)

Testing a program to make sure it works

60.

The condition for a while loop to continue could include which of the following?

a)

while something equals something

b)

while something is true

c)

while something is greater than something

d)

All of these

61.

while loops are ___.

a)

loops which run an unknown number of times

b)

the same as if statements

c)

loops which run for a specific number of times

d)

not a part of programming

62.

The output of the following code is either 1 or 2.

a)

True

b)

False

c)

Error

63.

Which of the following is not a valid variable name in Python?

a)

1_variable

b)

variable_1

c)

_variable

d)

variable1

64.

In Python, what does the "==" operator do?

a)

Assigns the value on the right to the variable on the left

b)

Checks if two values are not equal

c)

Checks if two values are equal

d)

Converts the value on the left to the type of the value on the right

65.

Which data structure in Python is mutable AND ordered?

a)

Dictionary

b)

Tuple

c)

Set

d)

List

66.

What will be the output of the following code snippet?

a)

apple

b)

apple

banana

c)

apple

banana

cherry

d)

Error

67.

What is the output of the following code?

a)

Syntax Error

b)

5

c)

3

d)

Parameter Error

68.

An ordered set of values between a known start and end value is the

a)

radius

b)

loop

c)

range

d)

expression

69.

What output is produced by:

x = 19.29428347

x = x * 100

num = int(x)

print(num)

a)

19.2943

b)

19

c)

1929

d)

19.29

70.

Consider the following code:

c = 100

c = c + 1

c = c + 1

print(c)

(a)  

71.

To create a random number between -20 and 20 you would use:

a)

print (random.random(-20))

b)

print (random.randint(-20,20))

c)

print (random.randint(20) -20)

d)

print(random.random() -20)

72.

What is a packet and why does the Internet break messages into packets?

a)

A packet is any e-mail attachment; smaller pieces bypass censorship filters.

b)

A packet is a small chunk of data tagged with addressing info so it can be routed independently and reassembled, improving reliability and efficiency.

c)

A packet is an error signal; splitting data lets routers detect hackers.

d)

A packet is a video frame; dividing frames saves hard-drive space.

73.

Which statement correctly contrasts IP and TCP?

a)

IP guarantees perfect delivery; TCP is “best effort.”

b)

IP handles addressing/routing, while TCP adds reliable, ordered delivery with error recovery.

c)

IP encrypts data; TCP assigns domain names.

d)

IP compresses packets; TCP splits them into bits.

74.

What problem does the Domain Name System (DNS) solve?

a)

It authenticates users before login.

b)

It measures network latency.

c)

It translates human-readable web names into numeric IP addresses.

d)

It prevents duplicate packets on a network.

75.

Which ordered list best describes what happens when you visit `www.code.org`?

a)

TCP handshake → HTTP request → DNS lookup.

b)

HTTP request → TCP handshake → DNS lookup.

c)

DNS lookup → TCP handshake → HTTP request.

d)

DNS lookup → HTTP request → TCP handshake.

76.

Why does redundancy among routers increase Internet reliability?

a)

Extra routers lower ISP bills.

b)

If one path fails, packets can automatically reroute through alternate paths.

c)

Redundancy keeps DNS servers synchronized.

d)

Routers remove malicious code from duplicate packets.

77.

HTTPS differs from HTTP because HTTPS …

a)

uses TLS/SSL to encrypt traffic, adding a security layer beneath the application protocol.

b)

bypasses DNS entirely.

c)

compresses webpages for faster load times only on mobile.

d)

requires IPv6 addresses instead of IPv4.

78.

A website feels sluggish but `ping` times remain normal. Which network metric most likely worsened?

a)

Latency, due to satellite routing.

b)

Bandwidth, perhaps throttled by your ISP or heavy local traffic.

c)

IP addressing, due to DHCP renewal.

d)

DNS resolution time, caused by spoofing.

79.

Which of the devices in the network are considered computing devices?

A smart temperature sensor: It runs a program that checks whether the temperature is above or below the target range for that time of day and then triggers the heating or cooling system when needed.

A security camera: It uses a machine learning algorithm to detect non-plant motion and sends video footage to a computer.

A desktop computer: It generates a graph of the temperature based on data from the temperature sensor and stores video footage from the camera.

A wireless router: It uses networking software to enable the sensor, computer, and camera to send data to each other.

a)

Just the desktop computer

b)

Just the desktop computer and wireless router

c)

The desktop computer, security camera, and router

d)

All of them (the computer, router, camera, and sensor)

80.

A small part of the data is sent over the network.

a)

Data packet

b)

Router

c)

File

d)

IP address

81.
Consider these three statements: I. Interviewing potential users of the app. II. Writing the entire program code before testing any parts of it. III. Observing users attempting to use the app. Which of the above actions would usually be helpful in designing and developing the app?
a)
I and II only
b)
I and III only
c)
II and III only
d)
I, II, and III
e)
None of these would usually be helpful
82.
Which of the following best describes the purpose of a design specification?
a)
Tracking errors that arise through user testing
b)
Documenting comments that will need to be added to a program
c)
Describing the requirements for how a program will work or users will interact with it
d)
Listing detailed questions that will be asked of users during interviews
83.
Which of the following is NOT a reason to include comments in programs?
a)
Comments help the computer decide whether certain components of a program are important.
b)
Comments help programmers debug issues in their own code
c)
Comments help document how code was written for other programmers to use
d)
Comments enable programmers to track their work throughout the development process
84.
A company that develops apps wants to create/assemble a team of collaborative developers/coders from a variety of professional and cultural backgrounds to create a new app. Which of the following is NOT a likely benefit of creating such a team?
a)
It will eliminate the need to do testing of the app.
b)
It can help the team anticipate the needs of a variety of users.
c)
It can help the team avoid bias in the app.
d)
The team can reflect and utilize the strengths of the individual team members.
85.
a)
A
b)
B
c)
C
d)
D
86.
Which of the following actions are generally helpful in program development?
a)
I and II only
b)
I and III only
c)
II and III only
d)
I, II, and III
87.

​ ​ (a)  

​ (b)   ​ ​

​ (c)  

​ (d)  

my_turtle.right(90)​ ​ ​

(e)  

wn.mainloop()

Choose from the below words
import turtle
for i in range(4):
my_turtle = turtle.Turtle()
my_turtle.forward(size)
wn = turtle.Screen()