# NPTEL Programming Data Structures And Algorithms Using Python Assignment 2 Answers 2022 NPTEL Programming Data Structures And Algorithms Using Python ASSIGNMENT 2 Answers:- Hello students in this article we are going to share NPTEL Programming Data Structures And Algorithms Using Python assignment week 2 answers. All the Answers provided below to help the students as a reference, You must submit your assignment at your own knowledge.

Below you can find NPTEL Programming Data Structures And Algorithms Using Python Assignment 2 Answers

### NPTEL Programming Data Structures And Algorithms Using Python Assignment 2 Answers 2022:-

Q1. One of the following 10 statements generates an error. Which one? (Your answer should be a number between 1 and 10.)

``````x = [[3,5],"mimsy",2,"borogove",1]  # Statement 1
y = x[0:50]                          # Statement 2
z = y                                # Statement 3
w = x                                # Statement 4
x = x[:5] + 'ery'              # Statement 5
y = 4                             # Statement 6
w[:3] = 'fea'                     # Statement 7
z = 42                            # Statement 8
x = 5555                       # Statement 9
a = (x == 1)                   # Statement 10``````

Q2. Consider the following lines of Python code.

Which of the following holds at the end of this code?

``````b = [43,99,65,105,4]
a = b[2:]
d = b[1:]
c = b
d = 95
b = 47
c = 73``````

Answers:- c – a == 65, b == 73, c == 73, d == 95

Q3. What is the value of endmsg after executing the following lines?

``````startmsg = "anaconda"
endmsg = ""
for i in range(1,1+len(startmsg)):
endmsg = endmsg + startmsg[-i]``````

Q4. What is the value of mylist after the following lines are executed?

``````def mystery(l):
l = l[2:]
return(l)

mylist = [7,11,13,17,19,21]
mystery(mylist)``````