Unit Test Answers

19 verified answers
1
Free Preview

Which of these are characteristics of variables? Check all that apply.

A
Variables can be local or global.
B
Variables cannot be changed.
C
Variables have keys and values within brackets [ ].
D
Variables have connected sets of characters.
E
Variables have names, extents, and scopes.
5

Question text not available

Answer not available
6

Which of the following are characteristics of global variables? Check all that apply.

A
They are accessible from anywhere in the program.
B
They are accessible only in specific regions of a program.
C
They are accessible only within a declared function.
D
They are accessible during the entire time the program is running.
9

Which of these are characteristics of a Python data type? Check all that apply.

A
A Python data type is weakly typed.
B
A Python data type can have numeric values.
C
A Python data type can be shown by keys and values within brackets [ ].
D
A Python data type must be stated before it can be used in a program.
E
A Python data type can be a string, a list, or a tuple with items that can be repeated using the asterisk ( * ).
F
A Python data type can be a dictionary that can be updated, changed, or removed.
G
A Python data type cannot have connecting sets of characters separated by commas.
11

Which of these are correctly formatted Python lists? Check all that apply.

A
list1=(race, cars, trucks, bikes)
B
list2=[‘computer science’, ‘math’, ‘psychology’]
C
list3=[“Programming 101”, “Intro to Python”]
D
list4=(‘summer’, ‘fall’, ‘winter’, ‘spring’)
E
list5=[52, 24, 71, 72, 56]
12

Which of these are correctly formatted Python dictionaries? Check all that apply.

A
dict = {‘Name’: ‘Matthew’, ‘Age’: 14, ‘School’: ‘ABC School’};
B
dict = (‘Name’: ‘Mary’, ‘Age’: 13, ‘School’: ‘XYZ School’)
C
dict = [“Programming Basics”, “Introduction to Python”]
D
dict = {‘season’: ‘fall’, ‘weather’: ‘cool’};
E
dict = ’[‘laptop’, ‘computer’, ‘hard drive’]
13

Which of these are correctly formatted Python tuples? Check all that apply.

A
tup1=(‘computer science’, ‘math’, ‘psychology’)
B
list1=[“final”, “complete”, “finish”]
C
tup2=“Programming 101”, “Intro to Python”
D
tup3=[“MacBook”, “Dell”, “IBM”]
E
tup4=(‘laptop’, ‘computer’, ‘hard drive’)
15

Question text not available

Answer not available
17

Question text not available

Answer not available
19

Question text not available

Answer not available

Did you find these answers helpful?