These multiple choice quesitons are for Python Math/Types and Storing Multiple Values in Lists.
-
Python Math/Types
apples = 10 oranges = ‘12’
What is the correct way to add the number of apples to the number of oranges?
apples + oranges
apples.append(oranges)
apples + int(oranges)
-
str(apples) + oranges
- Python Lists (Multiple Items in Lists)
Consider the following code:
fruits = ['apples', 'oranges', 'bananas']
tangerines = (2, 9)
fruits.append(tangerines)
What is the output of print(fruits)
?
['apples', 'oranges', 'bananas', (2, 9)]
['apples', 'oranges', 'bananas', 2, 9]
['apples', 'oranges', 'bananas', [2, 9]]
['apples', 'oranges', 'bananas'], (2, 9)
Explanation of distractors:
- correct answer
- Student believes each of the items in ‘tangerines’ tuple is individually added to the ‘fruits’ list.
- Student believes ‘tangerines’ is a list.
- Student doesn’t fully grasp list structure - knows that ‘tangerines’ should be added to the end of the list, but fails to incorporate it into the list structure.