Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Combinatorial Testing In Cloud Computing

Authors: Wei-Tek Tsai ,Guanqiu Qi

1st Edition

9811044805, 978-9811044809

More Books

Students also viewed these Programming questions

Question

What is meant by organisational theory ?

Answered: 1 week ago

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago

Question

Define policy making?

Answered: 1 week ago

Question

Define co-ordination?

Answered: 1 week ago