Question: 1 The expression data[1] evaluates to a 10 b 20 2 The expression data[1:3] evaluates to a [10, 20, 30] b [20, 30] 3 The

1 The expression data[1] evaluates to

a 10

b 20

2 The expression data[1:3] evaluates to

a [10, 20, 30]

b [20, 30]

3 The expression data.index(20) evaluates to

a 1

b 2

c True

4 The expression data + [40, 50] evaluates to

a [10, 60, 80]

b [10, 20, 30, 40, 50]

5 After the statement data[1] = 5, data evaluates to

a [5, 20, 30]

b [10, 5, 30]

6 After the statement data.insert(1, 15), data evaluates to

a [15, 10, 20, 30]

b [10, 15, 30]

c [10, 15, 20, 30]

For questions 710, assume that the variable info refers to the dictionary

{name:Sandy, age:17}.

7 The expression info.keys() evaluates to

a (name, age)

b [name, age]

8 The expression info.get(hobbies, None) evaluates to

a knitting

b None

c 1000

9 The method to remove an entry from a dictionary is named

a delete

b pop

c remove

10 Which of the following are immutable data structures?

a dictionaries and lists b strings and tuples

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 Databases Questions!