9/18/25, 2:54 PM Python for Data Science - - Unit 5 - Week 2
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)
[email protected]
NPTEL (https://swayam.gov.in/explorer?ncCode=NPTEL) » Python for Data Science (course)
If already
registered, click
to check your
Week 2 : Assignment 2
payment status The due date for submitting this assignment has passed.
Due on 2025-08-06, 23:59 IST.
Course Assignment submitted on 2025-08-04, 11:35 IST
outline
1) Which of the following object does not support indexing? 1 point
About tuple
NPTEL () list
dictionary
How does an
NPTEL set
online Yes, the answer is correct.
course Score: 1
work? () Accepted Answers:
set
Week 0 ()
2) How can you concatenate the strings “data” and “science” with a hyphen(-) 2 points
Week 1 () between them?
Week 2 () “data”.join(“science”)
“-”.join([“data”, “science”])
Jupyter setup
“data” + “-” + “science”
(unit?
unit=30&lesso None of the above.
n=31)
Partially Correct.
Sequence_dat
Score: 1
a_part_1 Accepted Answers:
(unit? “-”.join([“data”, “science”])
unit=30&lesso “data” + “-” + “science”
n=32)
https://onlinecourses.nptel.ac.in/noc25_cs104/unit?unit=30&assessment=168 1/5
9/18/25, 2:54 PM Python for Data Science - - Unit 5 - Week 2
Sequence_dat 3) What will be the output of the following code snippet? 2 points
a_part_2
(unit?
unit=30&lesso
n=33)
Sequence_dat
a_part_3
(unit?
unit=30&lesso [[ 5 12]
n=34) [21 32]]
Sequence_dat [[19 22]
a_part_4 [43 50]]
(unit?
[[3 8]
unit=30&lesso
[35 56]]
n=35)
[[ 5 21]
Numpy (unit?
[12 32]]
unit=30&lesso
n=36) Yes, the answer is correct.
Score: 2
Week 2 : Accepted Answers:
Lecture slides [[19 22]
(unit? [43 50]]
unit=30&lesso
n=37)
4) What will be the output of the following code snippet? 2 points
Week 2 -
FAQs (unit?
unit=30&lesso
n=38)
Week 2
Feedback
Form : Python
for Data [ 1 10 3 4 5 6 7 8 9 10]
Science!!
[ 10 1 2 3 4 5 6 7 8 9]
(unit?
unit=30&lesso [ 0 10 2 3 4 5 6 7 8 9]
n=114)
[ 10 2 3 4 5 6 7 8 9 ]
Quiz: Week 2 Yes, the answer is correct.
: Assignment Score: 2
2 Accepted Answers:
(assessment? [ 0 10 2 3 4 5 6 7 8 9]
name=168)
Practice: 5) What is the output of the following code? 2 points
Week 2:
Practice
Assignment 2
(assessment?
name=167)
Week 3 ()
Week 4 ()
[2, 3, 4, 5]
https://onlinecourses.nptel.ac.in/noc25_cs104/unit?unit=30&assessment=168 2/5
9/18/25, 2:54 PM Python for Data Science - - Unit 5 - Week 2
Supporting [0, 1, 2, 3]
material for [1, 2, 3, 4]
Week 4 () Will throw an error: Set objects are not iterable.
Download No, the answer is incorrect.
Score: 0
Videos ()
Accepted Answers:
[1, 2, 3, 4]
Problem
Solving 6) What will be the output of the following code snippet? 1 point
Session -
July 2025 ()
{27.5}
{1, 'four ', 3.0, 3, 5, 'two ', 10, 27.5}
{1, 'four ', 3.0, 5, 'two ', 10, 27.5}
{1, 'four ', 3.0, 5, 'two ', 3}
Yes, the answer is correct.
Score: 1
Accepted Answers:
{1, 'four ', 3.0, 5, 'two ', 10, 27.5}
7) Let t1 = (1, 2, “tuple”, 4) and t2 = (5, 6, 7). Which of the following will not give any 2 points
error after the execution?
t1.append(5)
x = t2[t1[1]]
t3 = t1 + t2
t3 = (t1, t2)
t3 = (list(t1), list(t2))
Yes, the answer is correct.
Score: 2
Accepted Answers:
x = t2[t1[1]]
t3 = t1 + t2
t3 = (t1, t2)
t3 = (list(t1), list(t2))
8) Let d = {1 : “Pyhton”, 2 : [1, 2, 3]}. Which among the following will not give the error 2 points
after the execution?
d[2].append(4)
x = d[0]
d[“one”] = 1
d.update({‘one’ : 2})
https://onlinecourses.nptel.ac.in/noc25_cs104/unit?unit=30&assessment=168 3/5
9/18/25, 2:54 PM Python for Data Science - - Unit 5 - Week 2
Yes, the answer is correct.
Score: 2
Accepted Answers:
d[2].append(4)
d[“one”] = 1
d.update({‘one’ : 2})
9) Which of the following data type is immutable? 1 point
list
set
tuple
dictionary
Yes, the answer is correct.
Score: 1
Accepted Answers:
tuple
10) student = {‘name’: ‘Jane’, ‘age’: 25, ‘courses’: [‘Math’, 2 points
‘Statistics’]}
Which among the following will return
{‘name’: ‘Jane’, ‘age’: 26, ‘courses’: [‘Math’, ‘Statistics’], ‘phone’:
‘123-456’}
student.update({‘age’ : 26})
student.update({‘age’ : 26, ‘phone’: ‘123-456’})
student[‘phone’] = ‘123-456’
student.update({‘age’ : 26})
None of the above
Partially Correct.
Score: 1
Accepted Answers:
student.update({‘age’ : 26, ‘phone’: ‘123-456’})
student[‘phone’] = ‘123-456’
student.update({‘age’ : 26})
11) What is the output of the following code? 1 point
[‘M’, ‘A’, ‘H’, ‘E’, ‘S’, ‘H’]
[‘m’, ‘a’, ‘h’, ‘e’, ‘s’, ‘h’]
[‘M’, ‘a’, ‘h’, ‘e’, ‘s’, ‘h’]
[‘m’, ‘A’, ‘H’, ‘E’, ‘S’, ‘H’]
https://onlinecourses.nptel.ac.in/noc25_cs104/unit?unit=30&assessment=168 4/5
9/18/25, 2:54 PM Python for Data Science - - Unit 5 - Week 2
Yes, the answer is correct.
Score: 1
Accepted Answers:
[‘M’, ‘A’, ‘H’, ‘E’, ‘S’, ‘H’]
12) What will be the output of the following code snippet? 2 points
[[1 2 3 4 5]
[3 4 5 6 7]
[5 6 7 8 9]]
[[1 2 3 4]
[3 4 5 6]
[5 6 7 8]]
[[2 3 4]
[4 5 6]
[6 7 8]]
None of the above
No, the answer is incorrect.
Score: 0
Accepted Answers:
[[1 2 3 4]
[3 4 5 6]
[5 6 7 8]]
https://onlinecourses.nptel.ac.in/noc25_cs104/unit?unit=30&assessment=168 5/5