0% found this document useful (0 votes)
4 views

py.quiz_assignment_week(01-06)

The document outlines the structure and assignments for 'The Joy of Computing using Python' course offered by NPTEL. It includes details about the first two weeks of assignments, quizzes, and topics covered, such as programming basics, loops, and variable handling. The document also provides feedback forms and links to course resources.

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)
4 views

py.quiz_assignment_week(01-06)

The document outlines the structure and assignments for 'The Joy of Computing using Python' course offered by NPTEL. It includes details about the first two weeks of assignments, quizzes, and topics covered, such as programming basics, loops, and variable handling. The document also provides feedback forms and links to course resources.

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/ 20

04/04/2025, 09:31 The Joy of Computing using Python - - Unit 4 - Week 1

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

[email protected]

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


Click to register for
Certification exam

Week 1 : Assignment 1
(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) Which blocks can be used to move the cat? 1 point
Course outline
Walk
Move
About NPTEL ()
Teleport
How does an NPTEL Glide
online course work? ()
No, the answer is incorrect.
Score: 0
Week 1 () Accepted Answers:
Move
Introduction to Glide
Programming (unit?
unit=17&lesson=18)
2) Which set of blocks moves the cat 40 steps and then points down ? 1 point
Why Programming?
(unit?unit=17&lesson=19)

Programming for
Everybody (unit?
unit=17&lesson=20)

Any Prerequisites? (unit?


unit=17&lesson=21)

Where to start? (unit?


unit=17&lesson=22)

Why do we have so many


languages? (unit?
unit=17&lesson=23)

How to go about
programming? (unit?
unit=17&lesson=24)

Why to learn
programming? (unit?
unit=17&lesson=25)

What is programming?
(unit?unit=17&lesson=26)

How to give instructions? Yes, the answer is correct.


(unit?unit=17&lesson=27) Score: 1
Accepted Answers:
Introduction to Scratch
(unit?unit=17&lesson=28)

Introduction to Loops
(unit?unit=17&lesson=29)

More about Loops (unit?


unit=17&lesson=30)
3) What does the cat say here ? 1 point
Solution to Looping
Problem (unit?
unit=17&lesson=31)

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=17&assessment=501 1/5
04/04/2025, 09:31 The Joy of Computing using Python - - Unit 4 - Week 1

Scratch : Animation 1
(unit?unit=17&lesson=32)

Scratch : Animation 2
(unit?unit=17&lesson=33)

Scratch : Animation 3
(unit?unit=17&lesson=34)

More on Scratch (unit?


unit=17&lesson=35)

Week 1 Feedback Form:


The Joy of Computing
using Python (unit?
unit=17&lesson=36)

Quiz: Week 1 :
Assignment 1
(assessment?
name=501) Says the number 7, for 1 second, 7 times and changes the value of number variable by multiplying previous value with 1.
Says the number 7, for 1 second, 7 times and changes the value of number variable by adding previous value with 1.
Week 2 ()
Says the number 7, for 1 second, then says numbers from 6 to 1 one by one for 1 second each.
Week 3 () Says the number 7, for 1 second, then says numbers from 6 to 0 one by one for 1 second each.

No, the answer is incorrect.


week 4 () Score: 0
Accepted Answers:
Week 5 () Says the number 7, for 1 second, then says numbers from 6 to 1 one by one for 1 second each.

4) From the previous question, what is the value of myNum variable after the loop ends ? 1 point
Week 6 ()
1
Week 7 () 2
7
Week 8 ()
0
Week 9 () Yes, the answer is correct.
Score: 1
Week 10 () Accepted Answers:
0
Week 11 ()
5) Let answer for previous question be stored in variable x, what does the cat say after the execution of the loop ? 1 point
Text Transcripts ()

Download Videos ()

Books ()

Problem Solving
Session - Jan 2025 ()

16
5
29
44
No, the answer is incorrect.
Score: 0
Accepted Answers:
5

6) Which of the following data types is primarily used for storing a sequence of characters in most programming languages? 1 point

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=17&assessment=501 2/5
04/04/2025, 09:31 The Joy of Computing using Python - - Unit 4 - Week 1

Integer
Float
String
Boolean

No, the answer is incorrect.


Score: 0
Accepted Answers:
String

7) Which of the following statements best describes why loops are commonly used ? 1 point

Loops make the code run slower but more reliably.


Loops allow you to execute a block of code repeatedly without having to write it multiple times.
Loops are only useful for error handling.
Loops automatically convert variables from one data type to another.

Yes, the answer is correct.


Score: 1
Accepted Answers:
Loops allow you to execute a block of code repeatedly without having to write it multiple times.

8) Suppose you have an arithmetic expression involving addition, subtraction, multiplication, and exponentiation. Which statement 1 point
is true about instructing a computer to evaluate it?

Such expressions cannot be computed.


A computer can only evaluate expressions involving addition and multiplication.
These expressions can be evaluated using built-in operations or libraries.
A computer can only evaluate expressions involving addition and subtraction.
Yes, the answer is correct.
Score: 1
Accepted Answers:
These expressions can be evaluated using built-in operations or libraries.

9) In which of the following code blocks calculation of the squared distance between two points (15, 25) and (20, 19) is 1 point
accomplished.

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=17&assessment=501 3/5
04/04/2025, 09:31 The Joy of Computing using Python - - Unit 4 - Week 1

Yes, the answer is correct.


Score: 1
Accepted Answers:

10) What task does the block below accomplish ? 1 point

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=17&assessment=501 4/5
04/04/2025, 09:31 The Joy of Computing using Python - - Unit 4 - Week 1

Moves the ball in a parabolic path and stops 18 away steps from center(0, 0) in x direction.
Moves the ball in a circular path and 18 times.
Moves the ball in a parabolic path and stops 18 away steps from center(0, 0) in y direction.
Moves the ball in a parabolic path and stops 17 away steps from center(0, 0) in x direction.

Yes, the answer is correct.


Score: 1
Accepted Answers:
Moves the ball in a parabolic path and stops 18 away steps from center(0, 0) in x direction.

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=17&assessment=501 5/5
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)

[email protected]

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
04/04/2025, 09:32 The Joy of Computing using Python - - Unit 6 - Week 3

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

[email protected]

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


Click to register for
Certification exam

Week 3 : Assignment 3
(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-12, 23:59 IST.


payment status
Assignment submitted on 2025-02-12, 21:28 IST
1) Which of the following is/are false statement(s)? 1 point
Course outline
Lists are fixed in size, they cannot store more than 1024 values
One can access element in list by using non-numeric indices
About NPTEL ()
Iterating over lists is possible in Python
How does an NPTEL We need to specify required size of list while creating a new list variable
online course work? ()
Yes, the answer is correct.
Score: 1
Week 1 () Accepted Answers:
Lists are fixed in size, they cannot store more than 1024 values
Week 2 () One can access element in list by using non-numeric indices
We need to specify required size of list while creating a new list variable
Week 3 ()
2) In the below code -
Lists Part 1 : Introduction
(unit?unit=57&lesson=58)

Lists Part 2 : Manipulation


(unit?unit=57&lesson=59)

Lists Part 3 : Operations


(unit?unit=57&lesson=60)

Lists Part 4 : Slicing (unit?


unit=57&lesson=61)

Loops and Conditionals :


Fizzbuzz 01 (unit?
unit=57&lesson=62)

Loops and Conditionals :


Fizzbuzz 02 (unit?
unit=57&lesson=63)

Crowd Computing - Just


estimate 01 (unit?
unit=57&lesson=64) For what value of n does the program print 10 ?
Crowd Computing - Just
estimate 02 (unit?
unit=57&lesson=65) No, the answer is incorrect.
Score: 0
Crowd Computing - Just
Accepted Answers:
estimate 03 (unit?
(Type: Numeric) 5
unit=57&lesson=66)
1 point
Crowd Computing - Just
estimate 04 (unit? 3) From the previous question, for what values of n is the number 25 appended to list a. 1 point
unit=57&lesson=67)
25
Crowd Computing - Just
estimate 05 (unit? 24
unit=57&lesson=68) 35
Crowd Computing - Just 32
estimate 06 (unit?

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

unit=57&lesson=69) Yes, the answer is correct.


Score: 1
Permutations - Jumbled Accepted Answers:
Words 01 (unit? 35
unit=57&lesson=70) 32
Permutations - Jumbled 4) What does the following code perform ? 1 point
Words 02 (unit?
unit=57&lesson=71)

Permutations - Jumbled
Words 03 (unit?
unit=57&lesson=72)

Theory of Evolution 01
(unit?unit=57&lesson=73)

Theory of Evolution 02
(unit?unit=57&lesson=74)

Theory of Evolution 03
(unit?unit=57&lesson=75)

Theory of Evolution 04 It converts any input list into a new list which is filled with some numbers which are always in increasing order
(unit?unit=57&lesson=76) It converts any input list into a new list such that at even indices, the value is a multiple of an even number and at odd indices, the
Week 3 Feedback Form : value is either even or negative number
The Joy of Computing It converts any input list into a new list such that at odd indices, the value is always even number and at even indices, the value is
using Python!! (unit? negative
unit=57&lesson=77)
It converts any input list into a new list, which follows no pattern
Quiz: Week 3 :
Yes, the answer is correct.
Assignment 3 Score: 1
(assessment? Accepted Answers:
name=508) It converts any input list into a new list such that at odd indices, the value is always even number and at even indices, the value is negative
Week 3: Programming
Assignment 1 5) From the previous question, if the option - 1 point
(/noc25_cs69/progassign It converts any input list into a new list such that at even indices, the value is a multiple of an even number and at odd
ment?name=510) indices, the value is either even or negative number.
Week 3: Programming
is incorrect, Can you make changes to code such that it this option is always true for
Assignment 2 any input ?
(/noc25_cs69/progassign
ment?name=511) No, it is not possible to make such changes
No, the option is already correct
Week 3: Programming
Assignment 3 Yes, we can make changes
(/noc25_cs69/progassign Yes, the answer is correct.
ment?name=513) Score: 1
Accepted Answers:
week 4 () Yes, we can make changes

Week 5 () 6) If file.txt exists, Does the code successfully run ? 1 point

Week 6 ()

Week 7 ()

Week 8 ()

Week 9 () Yes
No
Week 10 ()
Yes, the answer is correct.
Score: 1
Week 11 ()
Accepted Answers:
Yes
Text Transcripts ()

7) Which of the following are examples of Social Computing ? 1 point


Download Videos ()
ChatGPT
Books ()
Wikipedia
Quora
Problem Solving
Session - Jan 2025 () Twitch

No, the answer is incorrect.


Score: 0
Accepted Answers:
Wikipedia
Quora

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

8) What does the following code print for n = 256? 1 point

PYTHON IS BORING
PYTHON IS FUN

Yes, the answer is correct.


Score: 1
Accepted Answers:
PYTHON IS BORING

9) From the previous question, is a.sort() responsible for printing of either of the two possible sentences ? 1 point

Yes, and the code may print ”PYTHON IS FUN”


No, it is purely dependent on variable n
No, it is not dependent on a.sort(), and the code will never print ”PYTHON IS FUN”

Yes, the answer is correct.


Score: 1
Accepted Answers:
No, it is not dependent on a.sort(), and the code will never print ”PYTHON IS FUN”

10) What does the code in question 8, calculate ?


Can you say what the values of k and b are if n = 245326785456 x 103359 .
If values of k and b are different, enter 0, else enter value of k.

No, the answer is incorrect.


Score: 0
Accepted Answers:
(Type: Numeric) 57

1 point

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=57&assessment=508 3/3
04/04/2025, 09:32 The Joy of Computing using Python - - Unit 7 - week 4

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

[email protected]

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


Click to register for
Certification exam

Week 4 : Assignment 4
(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-19, 23:59 IST.


payment status
Assignment submitted on 2025-02-19, 22:02 IST
1) Which of the following options provides the general formula for the magic constant of a magic square of size n, where all 1 point
Course outline elements are distinct numbers from 1 to n2 ?

About NPTEL () n(n


2
+ 1)

2
How does an NPTEL
online course work? () n
3

Week 1 ()
3
n + 2n

Week 2 () 2

4 2
n + n
Week 3 ()
2n

Yes, the answer is correct.


week 4 ()
Score: 1
Accepted Answers:
Practice is the key (unit?
2
n(n + 1)
unit=78&lesson=79)
2
Magic Square: Hit and n
4
+ n
2

Trial 01 (unit? 2n
unit=78&lesson=80)

Magic Square: Hit and


2) What would the magic constant be for a magic square of size 7, given that all elements in the square are distinct numbers from 1 1 point
Trial 02 (unit? to 49?
unit=78&lesson=81)
260
Magic Square: Hit and
111
Trial 03 (unit?
unit=78&lesson=82) 175
165
Magic Square: Hit and
Trial 04 (unit? Yes, the answer is correct.
unit=78&lesson=83) Score: 1
Accepted Answers:
Magic Square: Hit and 175
Trial 05 (unit?
unit=78&lesson=84)
3) Does transposing any magic square change the sum across some rows/columns/diagonal? 1 point
Let's program and play
(unit?unit=78&lesson=85) Yes
No
Dobble Game - Spot the
similarity 01 (unit? Yes, the answer is correct.
unit=78&lesson=86) Score: 1
Accepted Answers:
Dobble Game - Spot the No
similarity 02 (unit?
unit=78&lesson=87)
4) Which of the following are valid magic squares ? 1 point
Dobble Game - Spot the
similarity 03 (unit?
unit=78&lesson=88)

⎡ ⎤

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 1/3
04/04/2025, 09:32 The Joy of Computing using Python - - Unit 7 - week 4

10 3 13 8
Dobble Game - Spot the ⎡ ⎤

similarity 04 (unit? ⎢ 5 16 2 11 ⎥
⎢ ⎥
unit=78&lesson=89) ⎢ 4 9 7 14 ⎥
⎣ ⎦
What is your date of 15 6 12 1

birth? (unit?
unit=78&lesson=90) ⎡
20 − e 6 − e 26 − e 16 − e

⎢ 10 − e 32 − e 4 − e 22 − e ⎥
Birthday Paradox - Find ⎢ ⎥
⎢ 8 − e 18 − e 14 − e 28 − 2e ⎥
your twin 01 (unit?
⎣ ⎦
unit=78&lesson=91) 30 − e 12 − e 24 − e 2 − e

Birthday Paradox - Find


1 14 4 15
⎡ ⎤
your twin 02 (unit?
⎢ 8 11 5 10 ⎥
unit=78&lesson=92) ⎢ ⎥
⎢ 13 2 16 3 ⎥
Birthday Paradox - Find ⎣ ⎦
12 7 9 6
your twin 03 (unit?
unit=78&lesson=93)
π 14π 4π 15π
⎡ ⎤
Birthday Paradox - Find ⎢ 8π 11π 5π 10π ⎥
⎢ ⎥
your twin 04 (unit? ⎢ 13π 2π 16π 3π ⎥
unit=78&lesson=94) ⎣ ⎦
12π 7π 9π 6π

Birthday Paradox - Find


Yes, the answer is correct.
your twin 05 (unit? Score: 1
unit=78&lesson=95) Accepted Answers:
10 3 13 8
What's your favourite ⎡ ⎤

movie? (unit? ⎢ 5 16 2 11 ⎥
⎢ ⎥
unit=78&lesson=96) ⎢ 4 9 7 14 ⎥
⎣ ⎦
15 6 12 1
Guess the Movie Name
1 14 4 15
01 (unit? ⎡ ⎤

unit=78&lesson=97) ⎢ 8 11 5 10 ⎥
⎢ ⎥
⎢ 13 2 16 3 ⎥
Guess the Movie Name
⎣ ⎦
02 (unit? 12 7 9 6

unit=78&lesson=98) ⎡
π 14π 4π 15π

⎢ 8π 11π 5π 10π ⎥
Guess the Movie Name ⎢ ⎥
⎢ 13π 2π 16π 3π ⎥
03 (unit?
⎣ ⎦
unit=78&lesson=99) 12π 7π 9π 6π

Guess the Movie Name 5) What is the minimum number of people required to ensure that at least three of them share the same 30-minute birth interval? The
04 (unit? intervals start from 12:00 AM and each interval lasts for half an hour.
unit=78&lesson=100)
97
Guess the Movie Name
05 (unit? Yes, the answer is correct.
unit=78&lesson=101) Score: 1
Accepted Answers:
Guess the Movie Name (Type: Numeric) 97
06 (unit?
unit=78&lesson=102) 1 point

Week 4 Feedback Form: 6) Calculate the magic constant for 5x5 square, where all elements are distinct numbers from 1 to 25, is it same as the magic constant for
The Joy of Computing Ramanujan’s magic square ?
using Python (unit?
unit=78&lesson=103)
If yes, enter 0, else enter the absolute difference between the two.
Quiz: Week 4 : Hint: Search the about Ramanujan’s magic square.
Assignment 4
(assessment?
74
name=515)
Yes, the answer is correct.
Score: 1
Week 4: Programming
Assignment 1
Accepted Answers:
(/noc25_cs69/progassign
(Type: Numeric) 74
ment?name=518)
1 point
Week 4: Programming
7) What task does mystery1() perform? 1 point
Assignment 2
(/noc25_cs69/progassign
ment?name=516)

Week 4: Programming
Assignment 3
(/noc25_cs69/progassign
ment?name=517)

Week 5 ()

Week 6 ()

Week 7 ()

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 2/3
04/04/2025, 09:32 The Joy of Computing using Python - - Unit 7 - week 4

Week 8 ()

Week 9 ()

Week 10 ()

Week 11 ()

Text Transcripts ()

Download Videos ()

Books ()

Problem Solving
Session - Jan 2025 ()

Calculate factorial of number n.


Calculate factors of number n.
Calculate factors of number n+1 excluding n.
Calculate factors of number n excluding n.

Yes, the answer is correct.


Score: 1
Accepted Answers:
Calculate factors of number n excluding n.

8) For what n1, n2 will the variable flag inside mystery2() be equal to True? 1 point

1,2
2,3
3,4
0,0

Partially Correct.
Score: 0.5
Accepted Answers:
2,3
3,4

9) If all possible pairs of prime numbers between 0 and 10, are given to n1 and n2, for how many pairs would 2 print ”Completed” ? 1 point

It will print ”Completed” only for pairs (2,3)(7,2),(2,5), and for the remaining it would not print ”Completed”.
It will print ”Completed” only for pair (2,3), and for the remaining other pairs of primes it would not print ”Completed”.
It will print ”Completed” for all pairs of primes between 0 and 20.
It will not print ”Completed” for any pair.
Yes, the answer is correct.
Score: 1
Accepted Answers:
It will not print ”Completed” for any pair.

10) If numbers of pairs of primes which result in mystery2 to print ”Completed” are lesser than 1, Can we edit the code in mystery2() 1 point
so that ”Completed” is always printed for any pair of primes ?

Yes, we can change the logic for setting flag variable to False.
No, it is logically not possible.
Yes, we can change/decrease the threshold for length of list2 in the last if block.
Yes, we can change the initial value of flag to False, instead of True.

No, the answer is incorrect.


Score: 0
Accepted Answers:
Yes, we can change/decrease the threshold for length of list2 in the last if block.

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 3/3
04/04/2025, 09:33 The Joy of Computing using Python - - Unit 8 - Week 5

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

[email protected]

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


Click to register for
Certification exam

Week 5 : Assignment 5
(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-26, 23:59 IST.


payment status
Assignment submitted on 2025-02-26, 21:50 IST
1) Which of the following is the correct way to add data with key as CS102 and value as 1 point
Course outline "Database Management Systems" to a dictionary named courses?

About NPTEL () courses["CS101"] = ("Database Management Systems")

How does an NPTEL courses["CS102"]["Database Management Systems"]

online course work? ()


courses["CS102"] = "Database Management Systems"

Week 1 ()
courses["CS101"] = "Database Management Systems"

Week 2 () Yes, the answer is correct.


Score: 1
Accepted Answers:
Week 3 () courses["CS102"] = "Database Management Systems"

week 4 () 2) What is the probability of Monty not opening the door with goat, given the hypothesis that you initially chose the door which has 1 point
car ?
Week 5 ()
0
Introduction to
0.5
Dictionaries (unit?
unit=104&lesson=105) 1
0.33
Speech to Text : No need
to write 01 (unit? Yes, the answer is correct.
unit=104&lesson=106) Score: 1
Accepted Answers:
Speech to Text : No need
0
to write 02 (unit?
unit=104&lesson=107)
3) What should be replaced with ? in line 10, so that there is high chance that final_choice is equal to 2 ? 1 point
Speech to Text : No need
to write 03 (unit?
unit=104&lesson=108)

Monte Hall : 3 doors and


a twist 01 (unit?
unit=104&lesson=109)

Monte Hall : 3 doors and


a twist 02 (unit?
unit=104&lesson=110)

Rock, Paper and Scissor :


Cheating not allowed !! 01
(unit?
unit=104&lesson=111)

Rock, Paper and Scissor :


Cheating not allowed !! 02 2
(unit?
unit=104&lesson=112) 2 ∗ ∗(1024) % 2 != 0
Rock, Paper and Scissor :
Cheating not allowed !! 03 2 ∗ (2 ∗ ∗(89) + 7) % 2 == 0

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=104&assessment=519 1/3
04/04/2025, 09:33 The Joy of Computing using Python - - Unit 8 - Week 5

(unit? (2 ∗ ∗(90)) % len(doors) != 1


unit=104&lesson=113)
Yes, the answer is correct.
Rock, Paper and Scissor : Score: 1
Cheating not allowed !! 04 Accepted Answers:
(unit? 2
unit=104&lesson=114) 2 ∗ (2 ∗ ∗(89) + 7) % 2 == 0

Sorting and Searching : 4) Given that you have a sorted list of 2048 elemets,what is the maximum number of comparisons to search such an element using 1 point
20 questions game 01 linear search ? Can binary search do it in less number of comparisons ?
(unit?
unit=104&lesson=115) Yes, binary search can do it more efficiently, linear search takes 1024 comparisons

Sorting and Searching : Yes, binary search can do it more efficiently, linear search takes 2048 comparisons
20 questions game 02 No, binary search may/may not do it more efficiently, linear search takes 1024 comparisons
(unit?
No, binary search will take more comparisons, linear search takes 2048 comparisons
unit=104&lesson=116)
Yes, the answer is correct.
Sorting and Searching : Score: 1
20 questions game 03 Accepted Answers:
(unit? Yes, binary search can do it more efficiently, linear search takes 2048 comparisons
unit=104&lesson=117)

Sorting and Searching : 5) What is the primary use of a file with a .wav or .wave extension? 1 point
20 questions game 04
(unit? Storing video recordings
unit=104&lesson=118) Storing log files
Sorting and Searching : Storing waves of files
20 questions game 05 Storing audio recordings
(unit?
unit=104&lesson=119) Yes, the answer is correct.
Score: 1
Sorting and Searching : Accepted Answers:
20 questions game 06 Storing audio recordings
(unit?
unit=104&lesson=120) 6) What does this program print in the end ? 1 point
Sorting and Searching :
20 questions game 07
(unit?
unit=104&lesson=121)

Sorting and Searching :


20 questions game 08
(unit?
unit=104&lesson=122)

Week 5 Feedback Form:


The Joy of Computing
using Python (unit?
unit=104&lesson=123)
Fraction of throws where both players showed different symbol(rock/paper/scissors)
Quiz: Week 5 :
Assignment 5 Fraction of throws where both players showed rock.
(assessment? Fraction of throws where both players showed same symbol(rock/paper/scissors)
name=519)
Fraction of throws where both players showed paper.
Week 5: Programming
No, the answer is incorrect.
Assignment 1 Score: 0
(/noc25_cs69/progassign
Accepted Answers:
ment?name=520)
Fraction of throws where both players showed different symbol(rock/paper/scissors)
Week 5: Programming
Assignment 2 7) In binary search the list gets divided in every iteration to find the element. 1 point
(/noc25_cs69/progassign
ment?name=521) True

Week 5: Programming
False
Assignment 3 Yes, the answer is correct.
(/noc25_cs69/progassign Score: 1
ment?name=522) Accepted Answers:
True
Week 6 ()
8) Which of the following are requirements for binary search to work correctly? 1 point
Week 7 ()
The list can be unsorted.
Week 8 () The list must contain only positive integers.
The list must be sorted.
Week 9 ()
The list must have no duplicate values.

Week 10 () Yes, the answer is correct.


Score: 1
Week 11 () Accepted Answers:
The list must be sorted.

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

9) Given an array [4, 2, 7, 1, 3], what will be the array after the third pass of Bubble Sort? 1 point
Text Transcripts ()

Download Videos () [1, 3, 2, 4, 7]

[2, 4, 1, 3, 7]
Books ()

[1, 2, 3, 4, 7]
Problem Solving
Session - Jan 2025 () [2, 1, 3, 4, 7]

Yes, the answer is correct.


Score: 1
Accepted Answers:
[1, 2, 3, 4, 7]

10) How many swaps are performed in iteration 3 for bubble sorting list [5,4,3,2,1]? Enter 0 if the list is sorted in less than 3 iterations.

Yes, the answer is correct.


Score: 1
Accepted Answers:
(Type: Numeric) 2

1 point

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=104&assessment=519 3/3
04/04/2025, 09:33 The Joy of Computing using Python - - Unit 9 - Week 6

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

[email protected]

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


Click to register for
Certification exam

Week 6 : Assignment 6
(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-03-05, 23:59 IST.


payment status
Assignment submitted on 2025-03-05, 22:02 IST
1) If n is a positive integer, what is the output of the function given input n, 1 point
Course outline

About NPTEL ()

How does an NPTEL


online course work? ()

Week 1 () Sum of numbers from 1 to n


Sum of numbers from 1 to n-1
Week 2 () n-1
n
Introduction to Anaconda
(unit?unit=37&lesson=38) Yes, the answer is correct.
Score: 1
Installation of Anaconda Accepted Answers:
(unit?unit=37&lesson=39) Sum of numbers from 1 to n
Introduction to Spyder
IDE (unit? 2) Assertion (A): If a recursive function doesn’t have a base case, it may never stop. 1 point
unit=37&lesson=40) Reason (R): Recursion means that a function calls itself.

Printing statements in
Both (A) and (R) are true, and (R) is the correct explanation of (A).
Python (unit?
unit=37&lesson=41)
Both (A) and (R) are true, but (R) is not the correct explanation of (A).
(A) is true, but (R) is false.
Understanding Variables
in Python (unit? (A) is false, but (R) is true.
unit=37&lesson=42) Yes, the answer is correct.
Score: 1
Executing a sequence of
Accepted Answers:
instructions in the
Both (A) and (R) are true, but (R) is not the correct explanation of (A).
Console (unit?
unit=37&lesson=43)
3) What is the output of following code ? 1 point
Writing your First
Program (unit?
unit=37&lesson=44)

Taking inputs from the


user (unit?
unit=37&lesson=45)

Discount Calculation
(unit?unit=37&lesson=46)

Motivation to if condition
(unit?unit=37&lesson=47)

A reminder on how to
deal with numbers (unit?
unit=37&lesson=48)

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

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=124&assessment=523 1/3
04/04/2025, 09:33 The Joy of Computing using Python - - Unit 9 - Week 6

Realizing the importance 26


of syntax and indentation
5
(unit?unit=37&lesson=50)
Yes, the answer is correct.
Introductions to loops Score: 1
(unit?unit=37&lesson=51) Accepted Answers:
26
Loops: Sum of numbers
(unit?unit=37&lesson=52) 4) In English, the letter ‘z’ usually appears far less often than most letters. Now imagine applying a Substitution Cipher to a large 1 point
Loops: Sum of numbers
body of English text, where ‘z’ is replaced by ‘r’, and every other letter is also mapped to a unique letter. After encryption, which letter is likely
(continued) (unit? to be the least frequent in the new text?
unit=37&lesson=53) Hint: Search the internet for more info, if needed.

Loops: Multiplication z
Tables (unit?
r
unit=37&lesson=54)
e
Introduction to While
It is not possible to determine
Loop (unit?
unit=37&lesson=55) Yes, the answer is correct.
Score: 1
Week 2 Feedback Form:
Accepted Answers:
The Joy of Computing
r
using Python (unit?
unit=37&lesson=56)
5) If you have a large ciphertext produced by a simple substitution cipher on an English text, can you determine the original 1 point
Quiz: Week 2 : message by examining how often each letter appears?
Assignment 2 Hint: Search the internet for more info, if needed.
(assessment?name=503)
Yes, it can be done.
Week 2: Programming
Assignment 1 No, it cannot be done.
(/noc25_cs69/progassign
Yes, the answer is correct.
ment?name=504) Score: 1
Week 2: Programming
Accepted Answers:
Assignment 2
Yes, it can be done.
(/noc25_cs69/progassign
ment?name=505) 6) Suppose you suspect that a piece of ciphertext was produced using a simple sub-stitution cipher. Under which circumstances 1 point
might frequency analysis fail to yield accurate results?
Week 2: Programming
Assignment 3
The ciphertext is short.
(/noc25_cs69/progassign
ment?name=506) The ciphertext was encrypted with another method before encrypting with sub-stitution cipher.
The ciphertext is very long.
Week 3 ()
Yes, the answer is correct.
Score: 1
week 4 () Accepted Answers:
The ciphertext is short.
Week 5 () The ciphertext was encrypted with another method before encrypting with sub-stitution cipher.

Week 6 () 7) If variable dict_name is a non-empty dictionary, what does dict name.values() re-turn? 1 point

Substitution Cipher -The Returns nothing, but prints all the keys in the dictionary.
science of secrecy (unit?
Returns a list of all the keys in the dictionary.
unit=124&lesson=125)
Returns a list of all the values in the dictionary.
Substitution Cipher -The
Returns a list of all the items in the dictionary.
science of secrecy 01
(unit? Yes, the answer is correct.
unit=124&lesson=126) Score: 1
Accepted Answers:
Substitution Cipher -The
Returns a list of all the values in the dictionary.
science of secrecy 02
(unit?
unit=124&lesson=127) 8) Assertion (A): A Caesar Cipher is a type of Substitution Cipher. 1 point
Reason (R): In a Caesar Cipher, each letter in the plaintext is replaced by a letter at a fixed shift in the alphabet.
Substitution Cipher -The
science of secrecy 03 Both (A) and (R) are true, and (R) is the correct explanation of (A).
(unit?
Both (A) and (R) are true, but (R) is not the correct explanation of (A).
unit=124&lesson=128)
(A) is true, but (R) is false.
Tic Tac Toe - Down the
(A) is false, but (R) is true.
memory Lane (unit?
unit=124&lesson=129) Yes, the answer is correct.
Score: 1
Tic Tac Toe - Down the Accepted Answers:
memory Lane 01 (unit? Both (A) and (R) are true, and (R) is the correct explanation of (A).
unit=124&lesson=130)

Tic Tac Toe - Down the 9) Which outcome generally follows from providing a proper base case in a recursive function? 1 point
memory Lane 02 (unit?
unit=124&lesson=131) The function returns a predefined result when the base condition is met.
It prevents infinite recursion and stops when a specific codition is met.

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=124&assessment=523 2/3
04/04/2025, 09:33 The Joy of Computing using Python - - Unit 9 - Week 6

Tic Tac Toe - Down the It ensures recursion depth is always constant.
memory Lane 03 (unit?
It allows the function to keep calling itself indefinitely.
unit=124&lesson=132)
Yes, the answer is correct.
Tic Tac Toe - Down the Score: 1
memory Lane 04 (unit? Accepted Answers:
unit=124&lesson=133) The function returns a predefined result when the base condition is met.
It prevents infinite recursion and stops when a specific codition is met.
Tic Tac Toe - Down the
memory Lane 05 (unit? 10) In a standard 3×3 Tic-Tac-Toe board, how many distinct winning lines (rows, columns, or diagonals) pass through the center 1 point
unit=124&lesson=134)
square?
Recursion (unit?
unit=124&lesson=135) 3
2
Recursion 01 (unit?
unit=124&lesson=136) 5
4
Recursion 02 (unit?
unit=124&lesson=137) Yes, the answer is correct.
Score: 1
Recursion 03 (unit? Accepted Answers:
unit=124&lesson=138) 4
Recursion 04 (unit?
unit=124&lesson=139)

Recursion 05 (unit?
unit=124&lesson=140)

Recursion 06 (unit?
unit=124&lesson=141)

Week 6 Feedback Form:


The Joy of Computing
using Python (unit?
unit=124&lesson=142)

Quiz: Week 6 :
Assignment 6
(assessment?
name=523)

Week 6: Programming
Assignment 1
(/noc25_cs69/progassign
ment?name=524)

Week 6: Programming
Assignment 2
(/noc25_cs69/progassign
ment?name=525)

Week 6: Programming
Assignment 3
(/noc25_cs69/progassign
ment?name=526)

Week 7 ()

Week 8 ()

Week 9 ()

Week 10 ()

Week 11 ()

Text Transcripts ()

Download Videos ()

Books ()

Problem Solving
Session - Jan 2025 ()

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=124&assessment=523 3/3

You might also like