Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Programming, Data Structures And Algorithms Using Python - - Unit 5... https://onlinecourses.nptel.ac.in/noc23_cs95/unit?

unit=33&assessment=146

(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)

vani.yamani@gmail.com 

NPTEL (https://swayam.gov.in/explorer?ncCode=NPTEL) » Programming, Data Structures And

Algorithms Using Python (course)


Click to register
for Certification
exam
(https://examform.nptel.ac.in
Week 2 Quiz
/2023_10 Your last recorded submission was on 2023-08-03, 17:31 IST Due date: 2023-08-09, 23:59 IST.
/exam_form All questions carry equal weightage. All Python code is assumed to be executed using Python3. You
/dashboard) may submit as many times as you like within the deadline. Your final submission will be graded.
Note:

If already • If the question asks about a value of type string, remember to enclose your answer in
registered, click single or double quotes.
to check your • If the question asks about a value of type list, remember to enclose your answer in square
payment status brackets and use commas to separate list items.

1) One of the following 10 statements generates an error. Which one? (Your answer should be a
number between 1 and 10.)

Course x = ["slithy",[7,10,12],2,"tove",1] # Statement 1


outline y = x[0:50] # Statement 2
z = y # Statement 3
How does an w = x # Statement 4
NPTEL online x[0] = x[0][:5] + 'ery' # Statement 5
course work? y[2] = 4 # Statement 6
() z[4] = 42 # Statement 7
w[0][:3] = 'fea' # Statement 8
Week 1 : x[1][0] = 5555 # Statement 9
Introduction a = (x[4][1] == 1) # Statement 10
()

8
Week 1 Quiz
() 2.5 points

2) Consider the following lines of Python code. 2.5 points

1 of 2 08-08-2023, 15:20
Programming, Data Structures And Algorithms Using Python - - Unit 5... https://onlinecourses.nptel.ac.in/noc23_cs95/unit?unit=33&assessment=146

Week 2: b = [23,44,87,100]
Basics of a = b[1:]
Python () d = b[2:]
c = b
Week 2 Quiz d[0] = 97
() c[2] = 77

Quiz: Week 2
Which of the following holds at the end of this code?
Quiz
(assessment? a[1] == 77, b[2] == 77, c[2] == 77, d[0] == 97
name=146)
a[1] == 87, b[2] == 87, c[2] == 77, d[0] == 97
Week 2 a[1] == 87, b[2] == 77, c[2] == 77, d[0] == 97
Programming a[1] == 97, b[2] == 77, c[2] == 77, d[0] == 97
Assignment ()
3) What is the value of endmsg after executing the following lines?
Week 3: Lists, startmsg = "python"
inductive endmsg = ""
function for i in range(1,1+len(startmsg)):
definitions,
endmsg = startmsg[-i] + endmsg
sorting ()

nohtyp
Week 3
Programming 2.5 points
Assignment ()
4) What is the value of mylist after the following lines are executed?

Text def mystery(l):


Transcripts () l = l[1:]
return()
Books ()
mylist = [7,11,13]
Download mystery(mylist)
Videos ()
[7, 11, 13]
Problem
2.5 points
Solving
You may submit any number of times before the due date. The final submission will be considered
Session -
for grading.
July 2023 ()
Submit Answers

2 of 2 08-08-2023, 15:20

You might also like