SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Y Daniel Lang
Chapter:
0.lists
Exercise:
Check Point
Question:5 | ISBN:978013274719 | Edition: 6

Question

Given list1 = [30, 1, 2, 1, 0] and list2 = [1, 21, 13], what is thereturn value of each of the following statements?
list1 + list2
2 * list2
list2 * 2
list1[1 : 3]
list1[3]

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

the return value of list1+list2 is

[30,1,2,1,0,1,21,13]

the return value of 2*list2 is

[1,21,13,1,21,13]

the return value of list2*2 is

[1,21,13,1,21,13]

the return value of list1[1:3] is 

[1,2]

the return value of list1[3] is 

1

0 0

Discussions

Post the discussion to improve the above solution.