0% found this document useful (0 votes)
55 views5 pages

Python For Data Science - Unit 5 - Week 2

The document outlines the second assignment for Week 2 of the Python for Data Science course on NPTEL, detailing various questions related to Python data structures and operations. It includes questions on indexing, string concatenation, code outputs, and data types, with correct answers and scores provided. The assignment was due on August 6, 2025, and submissions were recorded.

Uploaded by

Thangamari D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views5 pages

Python For Data Science - Unit 5 - Week 2

The document outlines the second assignment for Week 2 of the Python for Data Science course on NPTEL, detailing various questions related to Python data structures and operations. It includes questions on indexing, string concatenation, code outputs, and data types, with correct answers and scores provided. The assignment was due on August 6, 2025, and submissions were recorded.

Uploaded by

Thangamari D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

8/23/25, 3:49 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)


Click to register
for Certification
exam
Week 2 : Assignment 2
(https://examform.nptel.ac.in/2025_10/exam_form/dashboard)
The due date for submitting this assignment has passed.

If already
Due on 2025-08-06, 23:59 IST.
registered, click
to check your Assignment submitted on 2025-08-06, 12:36 IST
payment status
1) Which of the following object does not support indexing? 1 point

tuple

Course list
outline dictionary
set
About Yes, the answer is correct.
NPTEL () Score: 1
Accepted Answers:
How does an set
NPTEL
online 2) How can you concatenate the strings “data” and “science” with a hyphen(-) 2 points
course between them?
work? ()
“data”.join(“science”)
Week 0 () “-”.join([“data”, “science”])
“data” + “-” + “science”
Week 1 ()
None of the above.
Week 2 () Yes, the answer is correct.
Score: 2
Jupyter setup Accepted Answers:
(unit? “-”.join([“data”, “science”])
unit=30&lesso “data” + “-” + “science”
n=31)

https://onlinecourses.nptel.ac.in/noc25_cs104/unit?unit=30&assessment=168 1/5
8/23/25, 3:49 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_1
(unit?
unit=30&lesso
n=32)

Sequence_dat
a_part_2
(unit?
unit=30&lesso [[ 5 12]
n=33) [21 32]]
Sequence_dat [[19 22]
a_part_3 [43 50]]
(unit?
[[3 8]
unit=30&lesso
[35 56]]
n=34)
[[ 5 21]
Sequence_dat [12 32]]
a_part_4
(unit? Yes, the answer is correct.
unit=30&lesso
Score: 2
n=35) Accepted Answers:
[[19 22]
Numpy (unit? [43 50]]
unit=30&lesso
n=36)
4) What will be the output of the following code snippet? 2 points
Week 2 :
Lecture slides
(unit?
unit=30&lesso
n=37)

Week 2 - FAQs
(unit?
unit=30&lesso [ 1 10 3 4 5 6 7 8 9 10]
n=38)
[ 10 1 2 3 4 5 6 7 8 9]
Week 2 [ 0 10 2 3 4 5 6 7 8 9]
Feedback
Form : Python
[ 10 2 3 4 5 6 7 8 9 ]
for Data Yes, the answer is correct.
Science!! Score: 2
(unit? Accepted Answers:
unit=30&lesso [ 0 10 2 3 4 5 6 7 8 9]
n=114)

Quiz: Week 2 5) What is the output of the following code? 2 points


: Assignment
2
(assessment?
name=168)

Practice:
Week 2:
Practice
Assignment 2

[2, 3, 4, 5]

https://onlinecourses.nptel.ac.in/noc25_cs104/unit?unit=30&assessment=168 2/5
8/23/25, 3:49 PM Python for Data Science - - Unit 5 - Week 2

(assessment? [0, 1, 2, 3]
name=167)
[1, 2, 3, 4]
Week 3 () Will throw an error: Set objects are not iterable.

Yes, the answer is correct.


Week 4 () Score: 2
Accepted Answers:
Supporting [1, 2, 3, 4]
material for
Week 4 () 6) What will be the output of the following code snippet? 1 point

Download
Videos ()

Problem
Solving
Session - {27.5}
July 2025 ()
{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
8/23/25, 3:49 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

Yes, the answer is correct.


Score: 2
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
8/23/25, 3:49 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
Yes, the answer is correct.
Score: 2
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

You might also like