Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

List and Numerical Data

Total questions: 30

Worksheet time: 2hrs 30mins

Name
Class
Date
1.

When using adding, subtraction, or multiplication with an integer what do you return?

a)

Float

b)

integer

c)

Binary

d)

Hexadecimals

2.

What are the two main numerical data types?

a)

Binary, Hexadecimals

b)

Octal, Integer

c)

Float, Binary

d)

Integrer, Float

3.

When adding a comment to a program you must add what to the front of the line.

a)

()

b)

#

c)

@

d)

<>

4.

What is the correct format for defining a variable?

a)

front_door = 'Blue'

b)

Cookies='vanilla'

c)

username="Gigigi"

d)

gender = (male)

5.

What is a string made up of?

a)

10 or more characters

b)

only one character per string

c)

one or more characters

d)

numerical data only

6.

When you want to perform an action on a string what function do you use?

a)

Type function

b)

strip function

c)

String method function

d)

string function

7.

How do you insert the value from a variable into a string?

a)

print {f 'hello my dear friend, (name)!)

b)

print"f"(Hello my dear friend [name] !)

c)

print['f' "Hello my friend,{name} !]

d)

print( f"Hello my dear , { name } ! " )

8.

What is a compact way of defining a list in one line?

a)

Sorting List

b)

Numerical List

c)

List Comprehension

d)

Tuples

9.

What do you use to create a numerical list?

a)

The range() function

b)

the odd() function

c)

The round() functions

d)

The pop()

10.

When you sort a list without affecting the original list what function do you use?

a)

Sort()

b)

num()

c)

index()

d)

Sorted()

11.

When sorting a list what sort function do you use?

a)

round() Function

b)

Sort() function

c)

Bin() Function

d)

Sorted() function

12.

What loop lets you work with each item in a list one item at a time?

a)

While Loop

b)

For Loop

c)

Do While Loop

d)

Do Loop

13.

What can you do with a copy of a list?

a)

Make another copy

b)

work with it

c)

Work with it without affecting the original list

d)

So you can slice it

14.

A slice is a part of a list that

a)

begins with the item at the first index and end with the item before the last index.

b)

begins with the item at the last index and end with the item at the first index.

c)

omits the first and last item in the list

d)

begins with third item in the list and end with the last item in the last

15.

What is a collection of items in a specific order and in square brackets?

a)

Reverse sorting list

b)

String List

c)

Comprehension List

d)

List

16.

What programming Language are we using?

a)

Python Script

b)

Java Script

c)

CICS

d)

Python

17.

What is the Level and Version of Python are we using?

a)

level 7 Version 1or 5

b)

level 2 Version1 1

c)

level 3 Version 8 or 9

d)

level 3 Version 6

18.

When using the division operation what numerical data is returned in all cases?

a)

Hexadecimal

b)

Integer

c)

Float

d)

Binary

19.

What is the purpose of the Type() function?

a)

To make sure that the program is typed correction

b)

identifies the data type of its argument.

c)

Compute complex code

d)

It clears the data field in all data types.

20.

Why do you write comments in your programs?

a)

It makes the program look good

b)

Makes the program run better

c)

It tells the program what to do

d)

Allow you to leave notes for yourself and others inside a program.

21.

What is a Tuple

a)

an ordered collection of items that can't be modified

b)

an ordered collection of items that can be modified

c)

an ordered collection of items that is changeable with parentheses

d)

an ordered collection of items that are numbers in quotations

22.

What is the purpose of () in a function?

a)

To write a definition inside of it

b)

Serve no purpose

c)

The section were the parameter or parameters are listed.

d)

Indicates that it is a function

23.

What is a variable?

a)

something that is a name

b)

Is a label for a value you want to use in a program

c)

A label that has not value

d)

A label that has a under_score.

24.

When naming a variable what kind of quotation marks are used?

a)

Only " "

b)

Only ' '

c)

Both " and =

d)

Both " " and ' '

25.

When using the remove() function what does it do to list?

a)

It remove the beginning of a list

b)

It remove the items in the middle of a list

c)

it remove a specific items from the list

d)

It only remove the end of a list

26.

What must a variable contain?

a)

only numbers

b)

Only underscores

c)

numbers and underscores

d)

Numbers, underscores and Letters

27.

What must a variable start with?

a)

Only numbers

b)

Only underscores

c)

Only letters and underscores

d)

Only letters

28.

How do the remove() function work?

a)

This function remove the whole list

b)

This function removes a specific item from a list

c)

This function remove the first item from the list

d)

This function remove the last item from the list

29.

The pop() function will do the following

a)

Remove and return the last item in a list and can also accept an index and will remove and return the item at that index.

b)

Return a item in a list and can also accept an index and will return the item at that index.

c)

Remove three items in a list and can also accept three index items.

d)

If a item appears more than once use the pop() to delete it.

30.

What happen when you modify an element in a Tuple?

a)

It changes the element position in the Tple

b)

You will get an error.

c)

It will sort the Tuple

d)

The Tuple reverse it sort back to the original Tuple