Question: Problem 3 : Lists ( Section: 0 . 1 1 ) 3 a . Consider the list myList , [ ' hello ' , 'there'

Problem 3: Lists (Section: 0.11)
3a. Consider the list myList ,['hello', 'there'],42,47].
What is the length of this list?
We get the number 47 by myList[5]. For what other value of x would mylist x give 47?
For what value of x would myList x give ['hello', 'there']?
Using slicing and list addition on myList, how could you get the list 1,2,47?
3b. Consider the two lists list1=[1,2,3] and list2=[4,5,6]. Using these two lists, list addition, indexing and slicing, write Python expressions that result in each of the following:
1,2,3,4,5,6
[1,2,3,[4,5,6]]
[1,2,[4,5,6],3,4]
Problem 3 : Lists ( Section: 0 . 1 1 ) 3 a .

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!