Question
PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON Question 1 Which symbols are used to indicate a list of values in Python? { } |
PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON
Question 1
Which symbols are used to indicate a list of values in Python?
{ } | |
| | | |
/ / | |
[ ] |
Question 2
Given the listnames['Robert', 'Ron', 'Bob']how would you assign 'Rob' as the second value instead of 'Ron'?
names[2] = 'Ron' to 'Rob' | |
names = 'Rob' | |
names[2] = 'Rob' | |
names[1] = 'Rob' |
Question 3
Given the listnames['Robert', 'Ron', 'Bob']how would you remove 'Ron' so that only 'Robert' and 'Bob' remain?
names[2] = '' | |
delete 'Ron' from names | |
del names[1] | |
del names[2] |
Question 4
For the following question, let's say user_list contains the list ['abc', '012', 'xyz', '789']. What does user_list[-2] evaluate to?
789 | |
xyz | |
abc | |
012 |
Question 5
For the following question, let's say user_list contains the list ['abc', '012', 'xyz', '789']. What does user_list[:2] evaluate to?
['012'] | |
['abc', '012'] | |
['xyz', '789'] | |
['abc', 'xyz'] |
Question 6
For the following question, let's say user_list contains the list ['abc', '012', 'xyz', '789']. What does user_list.index('xyz') evaluate to?
1 | |
3 | |
2 | |
0 |
Question 7
Both lists and tuples are mutable, meaning they can have values added, removed, or changed.
True | |
False |
Question 8
The concatenation + and replication * symbols work the same way with lists as they do with strings.
True | |
False |
Question 9
How do you write a tuple value with only the integer value 314 in it?
(314,) | |
[314] | |
314 | |
(314) |
Question 10
What function ensures any inner lists contained within the list that's being copied also get copied as well?
copy.copylists() | |
copy.copy() | |
copy.lists() | |
copy.deepcopy() |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started