wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Page 1

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which statement best describes data abstraction in programming?

a)

It stores files in folders for easy access

b)

It encrypts variables to protect data

c)

It hides details by naming a whole dataset

d)

It makes code run faster automatically

2.

What is the main difference between a list and a tuple in Python?

a)

Lists can change, tuples cannot change

b)

Tuples are longer than lists by default

c)

Lists start at index one by design

d)

Tuples store only numbers, not strings

3.

Which definition of index is correct for sequences like lists?

a)

Numbers match the item’s actual value

b)

Positions start at one and skip even numbers

c)

Positions start at zero and increase by one

d)

Labels are random and assigned by the OS

4.

Which keyword checks if a value appears in a list, tuple, or string?

a)

get

b)

find

c)

has

d)

in

5.

A value that does not change while a program runs is called what?

a)

Fixed index

b)

Static list

c)

Locked tuple

d)

Immutable

6.

Which statement about unsorted data is accurate?

a)

Items are grouped by even and odd

b)

Items are always increasing by value

c)

Items have no particular arranged order

d)

Items follow alphabetical arrangement

7.

Which search algorithm divides a sorted list into smaller parts to locate a target?

a)

Grid search

b)

Hash search

c)

Sequential search

d)

Binary search

8.

Sequential search is best described as what process?

a)

Checking each item one by one

b)

Jumping to the middle and halving

c)

Sorting before every comparison

d)

Comparing only indexes, not values

9.

You have a sorted list of 100 numbers. Which search should you use for fastest average performance?

a)

Random probing

b)

Binary search

c)

Sequential search

d)

Index-only scan

10.

You need to test whether the word "cat" appears anywhere in the string "The catalog is new". Which simple Python check works?

a)

"cat" in "The catalog is new"

b)

has("cat", "The catalog is new")

c)

get("cat", "The catalog is new")

d)

find("cat", "The catalog is new") == True