13
AssignmentMultiple Select

Unit Test

Question 13 • VA-Information Technology Fundamentals B

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

Answer
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’)

Explanation

A and E use parentheses around comma-separated values, which is a standard way to write a tuple. C is also a tuple: in Python, commas create the tuple, so parentheses are optional. B and D use square brackets, which create lists rather than tuples.

AI-written and checked against the verified answer.

Previous
Next