Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

"Searching " in Python

Total questions: 9

Worksheet time: 4mins

Name
Class
Date
1.

What is Big-O-Notation

a)

A notation used to express the size of oversized pizzas in Python

b)

A way to describe the worst-case scenario of an algorithm's runtime or space complexity

c)

A symbol used in Python for exponentiation operations

d)

A special font used by Python programmers for writing code comments

2.

What are the types of searching in Python?

a)

Circular and Spiral

b)

Zigzag and Diagonal

c)

Linear and Binary

d)

Random and Chaotic

3.

What is a "Searching" Algorithm in Python?

a)

A method for finding lost keys in a Python dictionary

b)

A program that searches for hidden Easter eggs in Python code

c)

A technique for searching the internet using Python web crawlers

d)

An algorithm for looking up information in a list or other data structure

4.

What are some real world applications of "Searching"

a)

Sorting through a messy closet to find a missing sock

b)

Searching for relevant information in a database or file system

c)

Looking for relevant information on websites and social media platforms

d)

Hunting for buried treasure using Python metal detectors

5.

Which of the following is an advantage of binary search over linear search?

a)

Binary search requires less memory compared to linear search.

b)

Binary search is easier to implement

c)

Binary search requires less memory

d)

Linear is better

6.

Using binary Search , at which position/index is Bob ?

[ Alice , Felix , Jasmin , kevin , Bob ]

a)

4

b)

5

c)

1

d)

2

7.

If the list of items in the list is not sorted, binary search still can be used to find a specific item.

a)

True

b)

False

8.

If a linear search is conducted on an unsorted array / List of integers [5, 8, 2, 10, 3, 6, 1, 9, 4, 7] and the search key is 6, what will be the output?

a)

5

b)

6

c)

1

9.

In a binary search algorithm applied to the sorted list of names ['patrick ', 'Bob', 'Charlie', 'David', 'Peter', 'Olivia'], what will be the output if the search key is "Peter"?

(Hint : Ascii Code)

a)

0

b)

5

c)

4

d)

1

e)

6