Python For Data Science Week 2 January 2024 #NPTEL #NPTEL_SOLUTION #Python_For_Data_Science

preview_player
Показать описание
#NPTEL
#NPTEL_SOLUTION
#Python_For_Data_Science

Which of the following object does not support indexing?
tuple
list
dictionary
set
[[1 2 3]
[4 5 6]
[7 8 9]]
[1 2 3]
[4 5 6]
[7 8 9]
What is the output of the following code?
[2, 3, 4, 5]
[0 1 2 3]
[1, 2, 3, 4]
Will throw an error: Set objects are not iterable.
What is the output of the following code?
Which of the following code gives output My friend’s house is in Chennai?





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



x=t2[t1[1]]


t3=t1+t2


t3=(t1,t2)


t3=(list(t1),list(t2))
Let d = {1 : “Pyhton”, 2 : [1, 2, 3]}. Which among the following will not give the error after the execution?

d[2].append(4)


x = d[0]


d[“one”] = 1


Which of the following data type is immutable?

list


set


tuple


dictionary
1student = {‘name’: ‘Jane’, ‘age’: 25, ‘courses’: [‘Math’, ‘Statistics’]}
Which among the following will return
{‘name’: ‘Jane’, ‘age’: 26, ‘courses’: [‘Math’, ‘Statistics’], ‘phone’: ‘123-456’}





student[‘phone’] = ‘123-456’


None of the above
What is the output of the following code?


[‘M’, ‘A’, ‘H’, ‘E’, ‘S’, ‘H’]


[‘m’, ‘a’, ‘h’, ‘e’, ‘s’, ‘h’]


[‘M’, ‘a’, ‘h’, ‘e’, ‘s’, ‘h’]


[‘m’, ‘A’, ‘H’, ‘E’, ‘S’, ‘H’]
Рекомендации по теме