Vous êtes sur la page 1sur 3

09/01/2018 Programming, Data Structures and Algorithms using Python - - Unit 5 - Week 2 Quiz

reviewer1@nptel.iitm.ac.in ▼

Courses » Programming, Data Structures and Algorithms using Python

Announcements Course Forum Progress Mentor

Unit 5 - Week 2 Quiz

Course
outline Week 2 Quiz
The due date for submitting this assignment has passed. Due on 2017-02-06, 23:59 IST.
How to access
the portal Submitted assignment

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

x = [1,"abcd",2,"efgh",[3,4]] # Statement 1
Week 2: Basics
of Python y = x[0:50] # Statement 2
z = y # Statement 3
Week 2 Quiz w = x # Statement 4
x[1] = x[1] + 'd' # Statement 5
Quiz : Week 2
x[1][1] = 'y' # Statement 6
Quiz
y[2] = 4 # Statement 7
Quiz : Week 2 z[0] = 0 # Statement 8
Quiz Answers
w[4][0] = 1000 # Statement 9
Week 2 a = (x[4][1] == 4) # Statement 10
Programming
Assignment

Week 3: Lists,
inductive No, the answer is incorrect.
function Score: 0
definitions, Accepted Answers:
sorting
(Type: Numeric) 6

Week 3 2.5 points


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

Week 4: Sorting, x = [13,4,17,1000]


Tuples, w = x[1:]
Dictionaries,
u = x[1:]
Passing
Functions, List y = x
Comprehension u[0] = 50
y[1] = 40
Week 4 Quiz
Which of the following is correct?
Week 4
Programming
Assignment
x[1] == 40, y[1] == 40, w[0] == 50, u[0] == 50
Week 5:
Exception x[1] == 4, y[1] == 40, w[0] == 4, u[0] == 50
handling, x[1] == 50, y[1] == 50, w[0] == 50, u[0] == 50
input/output, file

handling, string
https://onlinecourses.nptel.ac.in/noc17_cs10/unit?unit=25&assessment=26 1/3
09/01/2018 Programming, Data Structures and Algorithms using Python - - Unit 5 - Week 2 Quiz
handling, string x[1] == 40, y[1] == 40, w[0] == 4, u[0] == 50
processing
No, the answer is incorrect.
Week 5 Score: 0
Programming
Assignment Accepted Answers:
x[1] == 40, y[1] == 40, w[0] == 4, u[0] == 50
Week 6:
3) What is the value of endmsg after executing the following lines?
Backtracking,
scope, data
structures; startmsg = "hello"
stacks, queues endmsg = ""
and heaps
for i in range(0,len(startmsg)):
endmsg = startmsg[i] + endmsg
Week 6 Quiz

Week 7: Classes,
objects and user
defined
datatypes
No, the answer is incorrect.
Score: 0
Week 7 Quiz
Accepted Answers:
Week 8: Dynamic (Type: Regex Match) ^\s*olleh\s*$
programming, (Type: Regex Match) ^\s*\"olleh\"\s*$
wrap-up (Type: Regex Match) ^\s*\'olleh\'\s*$

Week 8 2.5 points


Programming
4) What is the value of mylist after the following lines are executed?
Assignment

def mystery(l):
l = l + l
return()

mylist = [31,24,75]
mystery(mylist)

No, the answer is incorrect.


Score: 0
Accepted Answers:
(Type: Regex Match) ^\s*\[\s*31,\s*24,\s*75\s*]\s*$

2.5 points

Next Page

© 2014 NPTEL - Privacy & Terms - Honor Code - FAQs -


A project of In association with

https://onlinecourses.nptel.ac.in/noc17_cs10/unit?unit=25&assessment=26 2/3
09/01/2018 Programming, Data Structures and Algorithms using Python - - Unit 5 - Week 2 Quiz

Funded by

Powered by

https://onlinecourses.nptel.ac.in/noc17_cs10/unit?unit=25&assessment=26 3/3

Vous aimerez peut-être aussi