Need help with this week’s assignment? Get detailed and trusted solutions for Programming, Data Structures And Algorithms Using Python Week 2 NPTEL Assignment Answers. Our expert-curated answers help you solve your assignments faster while deepening your conceptual clarity.
✅ Subject: Programming, Data Structures And Algorithms Using Python (nptel programming, DSA using python answers)
📅 Week: 2
🎯 Session: NPTEL 2025 July-October
🔗 Course Link: Click Here
🔍 Reliability: Verified and expert-reviewed answers
📌 Trusted By: 5000+ Students
For complete and in-depth solutions to all weekly assignments, check out 👉 NPTEL Programming, Data Structures and Algorithms using Python Week 1 Assignment Answers
🚀 Stay ahead in your NPTEL journey with fresh, updated solutions every week!
Programming, Data Structures And Algorithms Using Python Week 2 NPTEL Assignment Answers 2025
1. One of the following 10 statements generates an error. Which one? (Your answer should be a number between 1 and 10.)
x = [“slithy”,[7,10,12],2,”tove”,1] # Statement 1
y = x[0:50] # Statement 2
z = y # Statement 3
w = x # Statement 4
x[0] = x[0][:5] + ‘ery’ # Statement 5
y[2] = 4 # Statement 6
z[4] = 42 # Statement 7
w[0][:3] = ‘fea’ # Statement 8
x[1][0] = 5555 # Statement 9
a = (x[4][1] == 1) # Statement 10
Answer : See Answers
2. Consider the following lines of Python code.
b = [23,44,87,100]
a = b[1:]
d = b[2:]
c = b
d[0] = 97
c[2] = 77
Which of the following holds at the end of this code?
- a[1] == 77, b[2] == 77, c[2] == 77, d[0] == 97
- a[1] == 87, b[2] == 87, c[2] == 77, d[0] == 97
- a[1] == 87, b[2] == 77, c[2] == 77, d[0] == 97
- a[1] == 97, b[2] == 77, c[2] == 77, d[0] == 97
Answer :
3. What is the value of endmsg after executing the following lines?
startmsg = “python”
endmsg = “”
for i in range(1,1+len(startmsg)):
endmsg = startmsg[-i] + endmsg
Answer :
4. What is the value of mylist after the following lines are executed?
def mystery(l):
l = l[1:]
return()
mylist = [7,11,13]
mystery(mylist)
Answer : See Answers
Programming, Data Structures And Algorithms Using Python Week 2 NPTEL Assignment Answers 2024
1. 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[1] = x[1][:5] + 'ery' # Statement 5
y[1] = 4 # Statement 6
w[1][:3] = 'fea' # Statement 7
z[4] = 42 # Statement 8
x[0][0] = 5555 # Statement 9
a = (x[3][1] == 1) # Statement 10
Answer :- 7
2. Consider the following lines of Python code.
b = [43,99,65,105,4]
a = b[2:]
d = b[1:]
c = b
d[1] = 95
b[2] = 47
c[3] = 73
Which of the following holds at the end of this code?
- a[0] == 47, b[3] == 73, c[3] == 73, d[1] == 47
- a[0] == 65, b[3] == 105, c[3] == 73, d[1] == 95
- a[0] == 65, b[3] == 73, c[3] == 73, d[1] == 95
- a[0] == 95, b[3] == 73, c[3] == 73, d[1] == 95
Answer :- c
3. 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]
Answer :- "adnocana"
4. 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)
Answer :- [7, 11, 13, 17, 19, 21]


