Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
13 views

The Joy of Computing using Python - - Unit 5 - Week 2

The document outlines the Week 2 assignments for the NPTEL course 'The Joy of Computing using Python', detailing various programming questions and their accepted answers. It includes topics such as variable assignment, input handling, loops, and conditional statements. Additionally, it provides feedback on submitted answers and scores for the assignment.

Uploaded by

sanat seth
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)
13 views

The Joy of Computing using Python - - Unit 5 - Week 2

The document outlines the Week 2 assignments for the NPTEL course 'The Joy of Computing using Python', detailing various programming questions and their accepted answers. It includes topics such as variable assignment, input handling, loops, and conditional statements. Additionally, it provides feedback on submitted answers and scores for the assignment.

Uploaded by

sanat seth
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/ 3

04/04/2025, 09:32 The Joy of Computing using Python - - Unit 5 - Week 2

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

sanatseth24@gmail.com 

NPTEL (https://swayam.gov.in/explorer?ncCode=NPTEL) » The Joy of Computing using Python (course)


Click to register for
Certification exam

Week 2 : Assignment 2
(https://examform.nptel.ac.in/2025_01/exam_form/dashboard)

If already registered, The due date for submitting this assignment has passed.

click to check your Due on 2025-02-05, 23:59 IST.


payment status
Assignment submitted on 2025-02-05, 22:11 IST
1) Statement: If a variable is assigned a value once, the value in the variable cannot be changed in the variable. 1 point
Course outline
False, the variable stores all values it was assigned.
False, the variable stores the value from the latest assignment.
About NPTEL ()
True, the variable stores only the value from the second-last assignment.
How does an NPTEL True, the variable stores value from the initial assignment only.
online course work? ()
Yes, the answer is correct.
Score: 1
Week 1 () Accepted Answers:
False, the variable stores the value from the latest assignment.
Week 2 ()
2) Which of the following code blocks print - ”Ramesh talks to Suresh and Kamlesh” ? 1 point
Introduction to Anaconda
(unit?unit=37&lesson=38)

Installation of Anaconda
(unit?unit=37&lesson=39)

Introduction to Spyder
IDE (unit?
unit=37&lesson=40)

Printing statements in
Python (unit?
No, the answer is incorrect.
Score: 0
unit=37&lesson=41)
Accepted Answers:
Understanding Variables
in Python (unit?
unit=37&lesson=42)

Executing a sequence of
instructions in the
Console (unit?
unit=37&lesson=43)
3) What aren’t the correct ways to inform python that input is a decimal point number ? 1 point
Writing your First
Program (unit? in(input())
unit=37&lesson=44) float(input())
Taking inputs from the int(input())
user (unit? a = input()
unit=37&lesson=45)
a = int(a)
Discount Calculation Yes, the answer is correct.
(unit?unit=37&lesson=46) Score: 1
Accepted Answers:
Motivation to if condition
in(input())
(unit?unit=37&lesson=47)
int(input())
A reminder on how to a = input()
deal with numbers (unit? a = int(a)
unit=37&lesson=48)

Understanding if
condition's working (unit?
unit=37&lesson=49)

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=37&assessment=503 1/3
04/04/2025, 09:32 The Joy of Computing using Python - - Unit 5 - Week 2

Realizing the importance 4) The following program outputs 723 - 0 points


of syntax and indentation
(unit?unit=37&lesson=50)

Introductions to loops
(unit?unit=37&lesson=51)

Loops: Sum of numbers


(unit?unit=37&lesson=52)

Loops: Sum of numbers


(continued) (unit? For what value of a does the code output 123 ?
unit=37&lesson=53)
1
Loops: Multiplication
2
Tables (unit?
unit=37&lesson=54) 6
5
Introduction to While
Loop (unit? No, the answer is incorrect.
unit=37&lesson=55) Score: 0
Accepted Answers:
Week 2 Feedback Form: 6
The Joy of Computing
using Python (unit?
5) What does previous question calculate ? 0 points
unit=37&lesson=56)

Quiz: Week 2 : Calculates the factorial of a.


Assignment 2 Calculates the factorial of a-1 and adds 3
(assessment?
Calculates the factorial of a-1+3.
name=503)
Calculates the a multiples of a starting from 1 and adds 3.
Week 2: Programming
Assignment 1 Yes, the answer is correct.
Score: 0
(/noc25_cs69/progassign
ment?name=504)
Accepted Answers:
Calculates the factorial of a-1 and adds 3
Week 2: Programming
Assignment 2 6) Which loop is used to perform a set of repetitive tasks without a condition by default in Python? 1 point
(/noc25_cs69/progassign
ment?name=505) while loop
Week 2: Programming for loop
Assignment 3 do-while loop
(/noc25_cs69/progassign
while-range loop
ment?name=506)
Yes, the answer is correct.
Week 3 () Score: 1
Accepted Answers:
week 4 () for loop

Week 5 () 7) What happens when the condition inside the if and while evaluate to false ? 1 point

Week 6 () Python interpreter ignores the if/while blocks, and halts the program.
Python interpreter ignores the if/while blocks, and proceeds the program from the lines after the if/while block.
Week 7 () Python interpreter executes the if/while blocks, and rest of the program.
Python interpreter executes the if/while, and the programs runs in an infinite loop.
Week 8 ()
No, the answer is incorrect.
Score: 0
Week 9 ()
Accepted Answers:
Python interpreter ignores the if/while blocks, and proceeds the program from the lines after the if/while block.
Week 10 ()
8) The following program might/might not have an infinite loop. Does the program have infinite loop ? 0 points
Week 11 ()

Text Transcripts ()

Download Videos ()

Books ()

Problem Solving
Session - Jan 2025 ()

No, the program doesn’t have infinite loop.


Yes, it can be prevented by updating the value of a before the if block at line 3.
Yes, it can be prevented by removing both the if blocks inside the while loop.

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=37&assessment=503 2/3
04/04/2025, 09:32 The Joy of Computing using Python - - Unit 5 - Week 2

Yes, but it cannot be prevented.

No, the answer is incorrect.


Score: 0
Accepted Answers:
Yes, it can be prevented by updating the value of a before the if block at line 3.

9) For which of the following values of name and age variables does the following code print ”You are lucky”? 1 point

aryan, 20
arjun, 19
aakash, 16
anand, 18

Yes, the answer is correct.


Score: 1
Accepted Answers:
aryan, 20
anand, 18

10) For which of the options among the previous question, the program doesn’t print anything. 1 point

aryan, 20
aakash, 16
arjun, 19
anand, 18

Yes, the answer is correct.


Score: 1
Accepted Answers:
aakash, 16

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=37&assessment=503 3/3

You might also like