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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!