Professional Documents
Culture Documents
reviewer3@nptel.iitm.ac.in ▼
Unit 4 -
Week 2: Introduction to Python
Course
outline
Assignment 2
The due date for submitting this assignment has passed.
How to access As per our records you have not submitted this Due on 2018-08-15, 23:59 IST.
the portal assignment.
Pre-requisite 1) What is the value of a after this sequence of instructions is carried out? 1 point
assignment
a=0
Week 1: for i in range(10):
Introduction a=a+1
Week 2:
Introduction to
Python 9
10
Introduction to
Anaconda 11
Installation of 12
Anaconda
No, the answer is incorrect.
Introduction to
Spyder IDE Score: 0
Accepted Answers:
Printing
statements in 10
Python
2) What is the output when the following sequence of instructions is carried out in the 1 point
Understanding console?
Variables in
Python
a=1;a=a+1;a=a+2;a=a+3;print(a)
Executing a
sequence of
instructions in 4
the Console
5
Writing your
First Program 6
Taking inputs 7
from the user
No, the answer is incorrect.
Discount
Score: 0
Calculation © 2014 NPTEL - Privacy & Terms - Honor Code - FAQs -
Accepted Answers:
A project of
Motivation to if In association with
7
condition
3) What is the output of the following snippet if 5 is given as the input? 1 point
A reminder on
how to deal Funded by
with numbers c=input("Enter a number")
Programming
Assignment 1: IIT IIT Punjab
Printing a
IIT Punjab
message
IIT IIT Ropar
Programming
Assignment 2: IIT Ropar
Currency
Conversion No, the answer is incorrect.
Score: 0
Programming
Assignment 3: Accepted Answers:
Profit or Loss IIT IIT Ropar
Quiz :
5) What is the value of x at the end of the following sequence of instructions? 1 point
Assignment 2
Week 2 x=10
Feedback x=x*3
x=x+5
Week 3: Cool
Ideas (Part 1)
15
Week 4: Cool 30
Ideas (Part 2)
35
Week 5: Cool
45
Ideas (Part 3)
No, the answer is incorrect.
Week 6: Cool Score: 0
Ideas (Part 4)
Accepted Answers:
Week 7: Cool 35
Ideas(Part 5)
6) What is the value stored in the variable answer at the end of executing the following 1 point
snippet?
Week 8: Cool
Ideas(Part 6)
answer=1
Week 9: Cool for n in range(5):
Ideas(Part 7) answer=answer*2
Week 12 32
n=5
if(n>1):
print("Hello")
Hello
Nothing happens
n=5
if(n>1)
print("Hello")
Hello
Syntax error
Indentation error
Nothing happens
for i in range(3):
print(i)
1
2
0
1
2
3
1
2
1
2
3