0% found this document useful (0 votes)
245 views4 pages

Assigment - 2 - Week 2 - 2023 - G

This document appears to be an assignment submission for a NPTEL online course on Python for Data Science. It contains 10 multiple choice questions related to Python concepts like lists, tuples, dictionaries, strings and arrays. The student received full marks by selecting the right answer for each question. Examples tested include indexing, slicing, updating dictionaries and lists, data types, string methods and array operations.

Uploaded by

NSREDDY
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)
245 views4 pages

Assigment - 2 - Week 2 - 2023 - G

This document appears to be an assignment submission for a NPTEL online course on Python for Data Science. It contains 10 multiple choice questions related to Python concepts like lists, tuples, dictionaries, strings and arrays. The student received full marks by selecting the right answer for each question. Examples tested include indexing, slicing, updating dictionaries and lists, data types, string methods and array operations.

Uploaded by

NSREDDY
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/ 4

X

(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
payment status
Week 2: Assignment 2
The due date for submitting this assignment has passed.
Due on 2023-08-09, 23:59 IST.
Course outline
Assignment submitted on 2023-08-09, 21:31 IST
How does an NPTEL 1) Which of the following object does not support indexing? 1 point
online course work?
() tuple
list
Week 0 ()
dictionary

Week 1 () set

Yes, the answer is correct.


Week 2 () Score: 1
Accepted Answers:
Jupyter setup (unit? set
unit=30&lesson=31)
2) Given a NumPy array, arr = np.array([[[1, 2, 3], [4, 5, 6], [7, 8, 9]]]), what is the output of the 1 point
Sequence_data_part_1
(unit? command, print(arr[0][1])?
unit=30&lesson=32)
[[1 2 3]
Sequence_data_part_2 [4 5 6]
(unit? [7 8 9]
unit=30&lesson=33)
[1 2 3]
Sequence_data_part_3
[4 5 6]
(unit?
unit=30&lesson=34) [7 8 9]

Yes, the answer is correct.


Sequence_data_part_4
Score: 1
(unit?
Accepted Answers:
unit=30&lesson=35)
[4 5 6]
Numpy (unit?
unit=30&lesson=36) 3) What is the output of the following code? 1 point

Week 2 : Lecture
slides (unit?
unit=30&lesson=37)

Week 2 - FAQs (unit?


unit=30&lesson=38)

Practice: Week 2:
Assignment 2 (Non
Graded) (assessment?
name=110)
[2, 3, 4, 5]
Quiz: Week 2:
[0 1 2 3]
Assignment 2
(assessment? [1, 2, 3, 4]
name=118) Will throw an error: Set objects are not iterable.

Week 2 Feedback Yes, the answer is correct.


Form : Python For

S 1
Data Science (unit? Score: 1
unit=30&lesson=114) Accepted Answers:
[1, 2, 3, 4]
Week 3 ()
4) What is the output of the following code? 1 point
Week 4 ()

Download Videos ()

Books ()

Text Transcripts ()

Problem Solving
Session - July 2023
()

Yes, the answer is correct.


Score: 1
Accepted Answers:

5) Which of the following code gives output My friend’s house is in Chennai? 1 point

Yes, the answer is correct.


Score: 1
Accepted Answers:
6) Let t1 = (1, 2, “tuple”,4) and t2 = (5, 6, 7) . Which of the following will not give any error after the execution? 1 point

t1. append(5)

x = t2[t1[1]]

t3 = t1 + t2

t3 = (t1, t2)

t3 =( list(t1), list(t2))

Yes, the answer is correct.


Score: 1
Accepted Answers:
x = t2[t1[1]]

t3 = t1 + t2
t3 = (t1, t2)

t3 =( list(t1), list(t2))

7) Let d = {1 : “P yhton”, 2 : [1, 2, 3]}. Which among the following will not give the error after the execution? 1 point

d[2] .append(4)

x = d[0]

d[ “one”]= 1

d. update({‘one’ : 2 })

Yes, the answer is correct.


Score: 1
Accepted Answers:
d[2] .append(4)

d[ “one”]= 1

d. update({‘one’ : 2 })

8) Which of the following data type is immutable? 1 point

list
set
tuple
dictionary

Yes, the answer is correct.


Score: 1
Accepted Answers:
tuple

9) student = {‘name’: ‘Jane’, ‘age’: 25, ‘courses’: [‘Math’, ‘Statistics’]} 1 point


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: 1
Accepted Answers:
student.update({‘age’ : 26, ‘phone’: ‘123-456’})
student[‘phone’] = ‘123-456’
student.update({‘age’ : 26})
10) 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’]

Yes, the answer is correct.


Score: 1
Accepted Answers:
[‘M’, ‘A’, ‘H’, ‘E’, ‘S’, ‘H’]

You might also like