0% found this document useful (0 votes)
289 views84 pages

Joy of Computing Using Python

PYTHON FOR DATA SCIENCE NPTEL

Uploaded by

gireesh
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)
289 views84 pages

Joy of Computing Using Python

PYTHON FOR DATA SCIENCE NPTEL

Uploaded by

gireesh
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/ 84

10/3/24, 1:04 PM The Joy of Computing using Python - - Unit 3 - Week 0

Answer Submitted.
X

[email protected]

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

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

Announcements (announcements) About the Course (preview) Q&A (forum) Progress (student/home) Mentor (student/mentor)

Mentee List (student/mentee) Review Assignment (assignment_review) Course Recommendations (/course_recommendations)

Course outline Week 0 : Assignment 0


Your last recorded submission was on 2024-09-24, 12:01 IST
About NPTEL () Note : This assignment is only for practice purpose and it will not be counted towards the Final score

How does an NPTEL


1) What is the next number in the sequence 4, 8, 16, _? 1 point
online course work? ()

20
Week 0 ()
24
Practice: Week 0 : 28
Assignment 0
32

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=16&assessment=442 1/5
10/3/24, 1:04 PM The Joy of Computing using Python - - Unit 3 - Week 0

(assessment? Yes, the answer is correct.


name=442) Score: 1
Accepted Answers:
Week 1 () 32

2) What will be the sum of the sequence up to 5th term 9, 36, 144, 576, ...? 1 point
Week 2 ()
3069
Week 3 () 3070
3071
week 4 ()
3072
Week 5 () Yes, the answer is correct.
Score: 1
Week 6 () Accepted Answers:
3069
Week 7 ()
3) The diameter of the circle is 10cm. What will be the perimeter of the shape(Use pi = 3.14)? 1 point
Week 8 ()
31.4cm

Week 9 () 41.4cm
51.4cm
Week 10 () 61.4cm

Yes, the answer is correct.


Week 11 () Score: 1
Accepted Answers:
Text Transcripts () 31.4cm

Download Videos () 4) Choose the odd one out of the following 2, 3, 5, and 6. 1 point

Books () 2
3
Problem Solving 5
Session - July 2024 ()
6

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=16&assessment=442 2/5
10/3/24, 1:04 PM The Joy of Computing using Python - - Unit 3 - Week 0

Yes, the answer is correct.


Score: 1
Accepted Answers:
6

5) Which of the following is an Armstrong number? 1 point


(Armstrong number is a number that is equal to the sum of cubes of its digits.)

123
333
407
663

Yes, the answer is correct.


Score: 1
Accepted Answers:
407

6) The sum of the first ten natural numbers is? 1 point

45
54
55
60

Yes, the answer is correct.


Score: 1
Accepted Answers:
55

7) A couple of dice is rolled together. What is the probability of getting the same number on both dice? 1 point

1/6
1/36
1/3

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=16&assessment=442 3/5
10/3/24, 1:04 PM The Joy of Computing using Python - - Unit 3 - Week 0

Yes, the answer is correct.


Score: 1
Accepted Answers:
1/6

8) If the perimeter of a circle is equal to that of a square, then the ratio of their areas is 1 point

22: 7
14: 11
7: 22
11: 14

Yes, the answer is correct.


Score: 1
Accepted Answers:
14: 11

9) What is the Least Common Multiple of 4 & 8? 1 point

2
8
12
16

Yes, the answer is correct.


Score: 1
Accepted Answers:
8

10) The area of circle A is equal to the sum of the area of two small circles with diameters of 6cm and 8cm. Then the diameter of 1 point
circle A will be?

5
10

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=16&assessment=442 4/5
10/3/24, 1:04 PM The Joy of Computing using Python - - Unit 3 - Week 0

15
20

Yes, the answer is correct.


Score: 1
Accepted Answers:
10

Check Answers and Submit

Your score is: 10/10

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=16&assessment=442 5/5
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

[email protected]

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

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

Announcements (announcements) About the Course (preview) Q&A (forum) Progress (student/home) Mentor (student/mentor)

Mentee List (student/mentee) Review Assignment (assignment_review) Course Recommendations (/course_recommendations)

Course outline Week 1 : Assignment 1


The due date for submitting this assignment has passed.
About NPTEL () Due on 2024-08-07, 23:59 IST.

How does an NPTEL


online course work? ()
Assignment submitted on 2024-08-07, 11:57 IST
1) The cat wants to move 100 steps away slowly, and by the time it finishes moving 100 steps, it needs to slowly rotate as well 1 point
Week 0 () towards the opposite direction. Can both these tasks be accomplished by using single loop in scratch?

Week 1 () Yes
No
Introduction to
Programming (unit? Yes, the answer is correct.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 1/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

unit=17&lesson=18) Score: 1
Accepted Answers:
Why Programming? (unit?
Yes
unit=17&lesson=19)
2) Which block moves the cat as described in the previous question ? 1 point
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?


(unit?unit=17&lesson=27)

Introduction to Scratch
(unit?unit=17&lesson=28)

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

More about Loops (unit?


unit=17&lesson=30)

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 2/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

Solution to Looping
Problem (unit?
unit=17&lesson=31)

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)

Quiz: Week 1 :
Assignment 1
(assessment?
name=443)

Week 1 Feedback Form:


The Joy of Computing
using Python (unit?
unit=17&lesson=36)
Yes, the answer is correct.
Week 2 ()

Week 3 ()

week 4 ()

Week 5 ()

Week 6 ()

Week 7 ()

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 3/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

Score: 1
Week 8 () Accepted Answers:

Week 9 ()

Week 10 ()

Week 11 ()

Text Transcripts ()

Download Videos ()

Books ()

Problem Solving 3) What does the cat say here ? 1 point


Session - July 2024 ()

Says the number 4, for 1 second, 10 times and changes the value of number variable by multiplying previous value with 4.
Says the number 4, for 1 second, 10 times and changes the value of number variable by adding previous value with 4.
Says the number 4, and its multiples each for 1 second, till 40 and changes the value of number variable by multiplying previous value
with 4.
Says the number 4, and its multiples each for 1 second, till 40 and changes the value of number variable by adding previous value with
4.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 4/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

Yes, the answer is correct.


Score: 1
Accepted Answers:
Says the number 4, and its multiples each for 1 second, till 40 and changes the value of number variable by adding previous value with 4.

4) From the previous question, what is the value of number variable after the loop ends ? 1 point

40
44
36
4

Yes, the answer is correct.


Score: 1
Accepted Answers:
44

5) Let answer for previous question be stored in variable x, what does the cat say after the execution of the loop ? 1 point

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 5/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 6/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

16
5
29
44

Yes, the answer is correct.


Score: 1
Accepted Answers:
29

6) Which of the following is use case of variables in programming. 1 point

They are used to make the computer store program data into SSD.
They help in storing and retrieval of information/data while a task on the machine is running.
They simplify a task which involves processing repetitive procedures.They simplify a task which involves processing repetitive
procedures.
They help in running multiple tasks parallel to each other.
Yes, the answer is correct.
Score: 1
Accepted Answers:
They help in storing and retrieval of information/data while a task on the machine is running.

7) What is the concept that helps in instructing the computer to execute repetitive tasks ? 1 point

Functions
Variables
Conditionals
Loops

Yes, the answer is correct.


Score: 1
Accepted Answers:
Loops

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 7/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

8) Can polynomial expressions be instructed to computer in logically finite steps ? 1 point

Yes
No

Yes, the answer is correct.


Score: 1
Accepted Answers:
Yes

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

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 8/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 9/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

Yes, the answer is correct.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 10/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

Score: 1
Accepted Answers:

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 11/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

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

Moves the ball in a parabolic path and stops 21 away steps from center(0, 0) in x direction.
Moves the ball in a circular path and 21 times.
Moves the ball in a triangular path and end at the center (0, 0).

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 12/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 4 - Week 1

Moves the ball in a parabolic path and stops 20 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 20 away steps from center(0, 0) in x direction.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=17&assessment=443 13/13
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 5 - Week 2

[email protected]

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

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

Announcements (announcements) About the Course (preview) Q&A (forum) Progress (student/home) Mentor (student/mentor)

Mentee List (student/mentee) Review Assignment (assignment_review) Course Recommendations (/course_recommendations)

Course outline Week 2: Assignment 2


The due date for submitting this assignment has passed.
About NPTEL () Due on 2024-08-07, 23:59 IST.

How does an NPTEL


online course work? ()
Assignment submitted on 2024-08-07, 12:07 IST
1) Statement : If a variable is assigned multiple times, the latest value is not stored in the variable 1 point
Week 0 ()
False, the variable stores all values it was assigned
Week 1 () False, the variable stores the value from the latest assignment.
True, the variable stores the value from the second-last assignment.
Week 2 ()
True, the variable stores value from the initial assignment

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=37&assessment=444 1/8
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 5 - Week 2

Yes, the answer is correct.


Introduction to Anaconda
Score: 1
(unit?unit=37&lesson=38)
Accepted Answers:
Installation of Anaconda False, the variable stores the value from the latest assignment.
(unit?unit=37&lesson=39)
2) Which of the following code blocks print - ”Hello Ram Lakshman and Hanuman !” ? 1 point
Introduction to Spyder
IDE (unit?
unit=37&lesson=40)

Printing statements in
Python (unit?
unit=37&lesson=41)

Understanding Variables
in Python (unit?
unit=37&lesson=42)

Executing a sequence of
instructions in the
Console (unit?
unit=37&lesson=43)

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) Yes, the answer is correct.

A reminder on how to deal


with numbers (unit?
unit=37&lesson=48)

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=37&assessment=444 2/8
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 5 - Week 2

Score: 1
Understanding if
condition's working (unit? Accepted Answers:
unit=37&lesson=49)

Realizing the importance


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? 3) What aren’t the correct ways to inform python that input is an integer ? 1 point
unit=37&lesson=53)
in(input())
Loops: Multiplication
float(input())
Tables (unit?
unit=37&lesson=54) int(input())

Introduction to While Loop


a = input()
(unit?unit=37&lesson=55) a = int(a)

Quiz: Week 2:
Yes, the answer is correct.
Score: 1
Assignment 2
Accepted Answers:
(assessment?
in(input())
name=444)
float(input())
Programming Assignment
1 4) The following program outputs 722 - 1 point
(/noc24_cs113/progassign
ment?name=446)

Programming Assignment
2
(/noc24_cs113/progassign
ment?name=448)

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=37&assessment=444 3/8
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 5 - Week 2

Programming Assignment
3
(/noc24_cs113/progassign
ment?name=447)

Week 2 Feedback Form:


The Joy of Computing
using Python (unit?
unit=37&lesson=56)

Week 3 ()

week 4 ()

Week 5 ()
For what value of a does the code output 8 ?
Week 6 ()
2
Week 7 () 1
4
Week 8 ()
6

Week 9 () Yes, the answer is correct.


Score: 1
Week 10 () Accepted Answers:
4

Week 11 () 5) What does previous question calculate ? 1 point

Text Transcripts () Calculates the factorial of a.


Calculates the factorial of a and adds 2.
Download Videos () Calculates the a multiples of a starting from 1 and adds 2.
Calculates the factorial of a-1 and adds 2.
Books ()
Yes, the answer is correct.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=37&assessment=444 4/8
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 5 - Week 2

Score: 1
Problem Solving Accepted Answers:
Session - July 2024 () Calculates the factorial of a-1 and adds 2.

6) Which loop is used to perform a set of repetitive tasks based on condition in Python? 1 point

while loop
for loop
do-while loop
while-range loop

Yes, the answer is correct.


Score: 1
Accepted Answers:
while loop

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

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.
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.

Yes, the answer is correct.


Score: 1
Accepted Answers:
Python interpreter ignores the if/while blocks, and proceeds the program from the lines after the if/while block.

8) The following program might/might not have an infinite loop. Does the program have infinite loop ? 1 point

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=37&assessment=444 5/8
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 5 - Week 2

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.
Yes, but it cannot be prevented

Yes, the answer is correct.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=37&assessment=444 6/8
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 5 - Week 2

Score: 1
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

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=37&assessment=444 7/8
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 5 - Week 2

aakash, 17
aatreya, 18

Yes, the answer is correct.


Score: 1
Accepted Answers:
aatreya, 18

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

aryan, 20
arjun, 19
aakash, 17
aatreya, 18

Yes, the answer is correct.


Score: 1
Accepted Answers:
aakash, 17

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=37&assessment=444 8/8
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 6 - Week 3

[email protected]

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

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

Announcements (announcements) About the Course (preview) Q&A (forum) Progress (student/home) Mentor (student/mentor)

Mentee List (student/mentee) Review Assignment (assignment_review) Course Recommendations (/course_recommendations)

Course outline Week 3: Assignment 3


The due date for submitting this assignment has passed.
About NPTEL () Due on 2024-08-14, 23:59 IST.

How does an NPTEL


online course work? ()
Assignment submitted on 2024-08-07, 12:12 IST
1) Which of the following is/are true statement(s)? 1 point
Week 0 ()
Lists are used to store multiple values.
Week 1 () One can access element in list by using non-numeric indices.
Iterating over lists is possible in Python.
Week 2 ()
We need to specify required size of list while creating a new list variable.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=57&assessment=453 1/7
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 6 - Week 3

Yes, the answer is correct.


Week 3 () Score: 1
Accepted Answers:
Lists Part 1 : Introduction Lists are used to store multiple values.
(unit?unit=57&lesson=58) Iterating over lists is possible in Python.
Lists Part 2 : Manipulation
2) In the below code -
(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)

Crowd Computing - Just


estimate 02 (unit?
unit=57&lesson=65)

Crowd Computing - Just


estimate 03 (unit?
unit=57&lesson=66)

Crowd Computing - Just


estimate 04 (unit?
unit=57&lesson=67)

Crowd Computing - Just For what value of n does the program print 21 ?
estimate 05 (unit?

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=57&assessment=453 2/7
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 6 - Week 3

unit=57&lesson=68) 7
Crowd Computing - Just Yes, the answer is correct.
estimate 06 (unit? Score: 1
unit=57&lesson=69) Accepted Answers:
(Type: Numeric) 7
Permutations - Jumbled
Words 01 (unit?
1 point
unit=57&lesson=70)
3) From the previous question, for what values of n is the number 7 appended to list a. 1 point
Permutations - Jumbled
Words 02 (unit?
7
unit=57&lesson=71) 6

Permutations - Jumbled 8
Words 03 (unit? 9
unit=57&lesson=72)
Yes, the answer is correct.
Theory of Evolution 01 Score: 1
(unit?unit=57&lesson=73) Accepted Answers:
8
Theory of Evolution 02 9
(unit?unit=57&lesson=74)

Theory of Evolution 03 4) What does the following code perform ? 1 point


(unit?unit=57&lesson=75)

Theory of Evolution 04
(unit?unit=57&lesson=76)

Quiz: Week 3:
Assignment 3
(assessment?
name=453)

Week 3 Feedback Form:


The Joy of Computing
using Python (unit?
unit=57&lesson=77)

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=57&assessment=453 3/7
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 6 - Week 3

Week 3: Programming It converts any input list into a new list which is filled with some alternative even and odd numbers.
Assignment 1
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 value
(/noc24_cs113/progassign
is either odd or even number.
ment?name=456)
It converts any input list into a new list such that at even indices, the value is multiple of 2 and at odd indices, the value is multiple of 3.
Week 3: Programming
It converts any input list into a new list, which follows no pattern.
Assignment 2
(/noc24_cs113/progassign Yes, the answer is correct.
ment?name=457) Score: 1
Accepted Answers:
Week 3: Programming 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 value is
Assignment 3
either odd or even number.
(/noc24_cs113/progassign
ment?name=458) 5) From the previous question, if the option - 1 point
It converts any input list into a new list which is filled with some alternative even and odd numbers.
week 4 ()
is incorrect, Can you make changes to code such that this option is true ?

Week 5 () No, it is not possible to make such changes.


No, the option is already correct.
Week 6 ()
Yes, we can make changes.

Week 7 () Yes, the answer is correct.


Score: 1
Accepted Answers:
Week 8 ()
Yes, we can make changes.

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

Week 10 ()

Week 11 ()

Text Transcripts ()

Yes
Download Videos ()
No

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=57&assessment=453 4/7
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 6 - Week 3

Yes, the answer is correct.


Books () Score: 1
Accepted Answers:
Problem Solving No
Session - July 2024 ()
7) Which of the following are examples of Social Computing ? 1 point

StackOverflow
Wikipedia
Quora
None

Yes, the answer is correct.


Score: 1
Accepted Answers:
StackOverflow
Wikipedia
Quora

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

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=57&assessment=453 5/7
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 6 - Week 3

WE KNOW THE WISDOM OF SERIES


WE ARE YET TO KNOW MANY THINGS

Yes, the answer is correct.


Score: 1
Accepted Answers:
WE KNOW THE WISDOM OF SERIES

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

No, it is not dependent on variable n, the code will never print ”WE ARE YET TO KNOW MANY THINGS”.
Yes on a.sort() only, but the code will never print ”WE ARE YET TO KNOW MANY THINGS”.
Yes on both, the code may print both sentences.
No, it is not dependent on a.sort(), the code will never print ”WE ARE YET TO KNOW MANY THINGS”.

Yes, the answer is correct.


Score: 1
Accepted Answers:
No, it is not dependent on variable n, the code will never print ”WE ARE YET TO KNOW MANY THINGS”.
No, it is not dependent on a.sort(), the code will never print ”WE ARE YET TO KNOW MANY THINGS”.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=57&assessment=453 6/7
10/3/24, 1:06 PM The Joy of Computing using Python - - Unit 6 - Week 3

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


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

56

Yes, the answer is correct.


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

1 point

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=57&assessment=453 7/7
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 7 - week 4

[email protected]

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

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

Announcements (announcements) About the Course (preview) Q&A (forum) Progress (student/home) Mentor (student/mentor)

Mentee List (student/mentee) Review Assignment (assignment_review) Course Recommendations (/course_recommendations)

Course outline Week 4: Assignment 4


The due date for submitting this assignment has passed.
About NPTEL () Due on 2024-08-21, 23:59 IST.

How does an NPTEL


online course work? ()
Assignment submitted on 2024-08-21, 18:01 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
Week 0 () elements are distinct numbers from 1 to n2 ?

Week 1 ()
n(n2 + 1)
Week 2 () 2

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=78&assessment=454 1/8
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 7 - week 4

n3
Week 3 ()
2
week 4 () n3 + 2
2
Practice is the key (unit?
unit=78&lesson=79)
n4 + n2
Magic Square: Hit and 2n
Trial 01 (unit? Yes, the answer is correct.
unit=78&lesson=80) Score: 1
Accepted Answers:
Magic Square: Hit and
n(n2 + 1)
Trial 02 (unit?
unit=78&lesson=81) 2
n4 + n2
Magic Square: Hit and 2n
Trial 03 (unit?
2) What would the magic constant be for a magic square of size 6, given that all elements in the square are distinct numbers from 1 1 point
unit=78&lesson=82)
to 36?
Magic Square: Hit and
Trial 04 (unit? 72
unit=78&lesson=83) 111
Magic Square: Hit and 109
Trial 05 (unit?
110
unit=78&lesson=84)
Yes, the answer is correct.
Let's program and play Score: 1
(unit?unit=78&lesson=85) Accepted Answers:
111
Dobble Game - Spot the
similarity 01 (unit?
unit=78&lesson=86) 3) Does transposing the magic square give us a new magic square ? 1 point

Dobble Game - Spot the Yes


similarity 02 (unit?
No
unit=78&lesson=87)
Yes, the answer is correct.
Dobble Game - Spot the
similarity 03 (unit?

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=78&assessment=454 2/8
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 7 - week 4

unit=78&lesson=88) Score: 1
Accepted Answers:
Dobble Game - Spot the
Yes
similarity 04 (unit?
unit=78&lesson=89) 4) Which of the following are valid magic squares ? 1 point

What is your date of birth?


(unit?unit=78&lesson=90)
⎡ 10 3 13 8 ⎤
⎢ 5 16 2 11 ⎥
⎢ ⎥
⎢ 4 9 7 14 ⎥
Birthday Paradox - Find

⎣ 15 6 12 1 ⎦
your twin 01 (unit?
unit=78&lesson=91)

⎡ 20 − e 6 − e 26 − e 16 − e ⎤
Birthday Paradox - Find
your twin 02 (unit?
⎢ 10 − e 32 − e 4 − e 22 − e ⎥
⎢ ⎥
unit=78&lesson=92)
⎢ 8 − e 18 − e 14 − e 28 − e ⎥
Birthday Paradox - Find ⎣ 30 − e 12 − e 24 − e 2 − e ⎦
your twin 03 (unit?
unit=78&lesson=93)
⎡ 1 14 4 15 ⎤
⎢ 8 11 5 10 ⎥
Birthday Paradox - Find
⎢ ⎥
your twin 04 (unit?
⎢ 13 2 16 3 ⎥
unit=78&lesson=94)
⎣ 12 7 9 6 ⎦
Birthday Paradox - Find

⎡ π 15π ⎤
your twin 05 (unit? 14π 4π
⎢ 8π 10π ⎥
unit=78&lesson=95)
⎢ ⎥
11π 5π
⎢ 13π 2π 16π 3π ⎥
⎣ 12π 6π ⎦
What's your favourite
movie? (unit? 7π 9π
unit=78&lesson=96)
Yes, the answer is correct.
Guess the Movie Name Score: 1
01 (unit? Accepted Answers:
unit=78&lesson=97) ⎡ 10 3 13 8 ⎤
⎢ 5 16 2 11 ⎥
⎢ ⎥
⎢ 4 9 7 14 ⎥
Guess the Movie Name

⎣ ⎦
02 (unit?
unit=78&lesson=98) 15 6 12 1

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=78&assessment=454 3/8
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 7 - week 4

Guess the Movie Name ⎡ 20 − e 6 − e 26 − e 16 − e ⎤


⎢ 10 − e 32 − e 4 − e 22 − e ⎥
⎢ ⎥
03 (unit?
unit=78&lesson=99) ⎢ 8 − e 18 − e 14 − e 28 − e ⎥
⎣ 30 − e 12 − e 24 − e 2 − e ⎦
Guess the Movie Name
04 (unit? ⎡ 1 14 4 15 ⎤
⎢ 8 11 5 10 ⎥
⎢ ⎥
unit=78&lesson=100)
⎢ 13 2 16 3 ⎥
⎣ 12 7 9 6 ⎦
Guess the Movie Name
05 (unit?
unit=78&lesson=101) ⎡ π 14π 4π 15π ⎤
⎢ 8π 11π 5π 10π ⎥
⎢ ⎥
⎢ 13π 2π 16π 3π ⎥
Guess the Movie Name

⎣ 12π 7π 6π ⎦
06 (unit?
unit=78&lesson=102) 9π
Quiz: Week 4: 5) What is the minimum number of people required to ensure that at least two of them share the same 30-minute birth interval? The
Assignment 4 intervals start from 12:00 AM and each interval lasts for half an hour.
(assessment?
name=454) 49

Week 4: Programming Yes, the answer is correct.


Assignment 1 Score: 1
(/noc24_cs113/progassign Accepted Answers:
ment?name=459) (Type: Numeric) 49

Week 4: Programming 1 point


Assignment 2
(/noc24_cs113/progassign 6) Calculate the magic constant for 4x4 square, where all elements are distinct numbers from 1 to 16, is it same as the magic constant for
ment?name=461) Ramanujan’s magic square ?

Week 4: Programming
If yes, enter 0, else enter the absolute difference between the two.
Assignment 3
Hint: Search the about Ramanujan’s magic square.
(/noc24_cs113/progassign
ment?name=460)
105
Week 4 Feedback Form:
Yes, the answer is correct.
The Joy of Computing
using Python (unit?
unit=78&lesson=103)

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=78&assessment=454 4/8
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 7 - week 4

Score: 1
Week 5 () Accepted Answers:
(Type: Numeric) 105
Week 6 () 1 point

Week 7 () 7) What task does function1() perform ? 1 point

Week 8 ()

Week 9 ()

Week 10 ()

Week 11 ()

Text Transcripts ()

Download Videos ()

Books ()

Problem Solving
Session - July 2024 ()

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=78&assessment=454 5/8
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 7 - week 4

Calculate factorial of number n.


Calculate factors of number n.
Calculate prime factors of number n.
Calculate factors of number n excluding n.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=78&assessment=454 6/8
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 7 - week 4

Yes, the answer is correct.


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

8) For what n1,n2 flag will the variable flag inside function2() be not equal to true ? 1 point

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

Yes, the answer is correct.


Score: 1
Accepted Answers:
0,0
1,1
1,0

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

It will not print ”Completed” for any pair.


It will print ”Completed” only for pairs (2,3)(3,5),(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.

Yes, the answer is correct.


Score: 1
Accepted Answers:
It will print ”Completed” for all pairs of primes between 0 and 20.

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

Yes, we can change the logic for setting flag variable to True.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=78&assessment=454 7/8
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 7 - week 4

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

Yes, the answer is correct.


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

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=78&assessment=454 8/8
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 8 - Week 5

[email protected]

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

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

Announcements (announcements) About the Course (preview) Q&A (forum) Progress (student/home) Mentor (student/mentor)

Mentee List (student/mentee) Review Assignment (assignment_review) Course Recommendations (/course_recommendations)

Course outline Week 5: Assignment 5


The due date for submitting this assignment has passed.
About NPTEL () Due on 2024-08-28, 23:59 IST.

How does an NPTEL


online course work? ()
Assignment submitted on 2024-08-27, 15:36 IST
1) Which of the following is the correct way to add data with key as CS101 and value as "Web Programming" to a 1 point
Week 0 () dictionary named courseData?

Week 1 ()
courseData["CS101"].append("Web Programming")
Week 2 () courseData["CS101"]["Web Programming"]

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=104&assessment=462 1/7
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 8 - Week 5

Week 3 () courseData["CS101"] = "Web Programming";

week 4 () courseData["CS101"] = "Web Programming"


Yes, the answer is correct.
Week 5 () Score: 1
Accepted Answers:
Introduction to courseData["CS101"] = "Web Programming"
Dictionaries (unit?
unit=104&lesson=105) 2) What is the probability of Monty opening the door with goat, given the hypothesis that you initially chose the door which has car ? 1 point

Speech to Text : No need 0.5


to write 01 (unit?
0.66
unit=104&lesson=106)
0.33
Speech to Text : No need
1
to write 02 (unit?
unit=104&lesson=107) Yes, the answer is correct.
Score: 1
Speech to Text : No need
Accepted Answers:
to write 03 (unit?
1
unit=104&lesson=108)

Monte Hall : 3 doors and 3) What should be replaced with ? in line 10, so that there is high chance that final_choice is equal to 2 ? 1 point
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

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=104&assessment=462 2/7
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 8 - Week 5

(unit?
unit=104&lesson=112)

Rock, Paper and Scissor :


Cheating not allowed !! 03
(unit?
unit=104&lesson=113)

Rock, Paper and Scissor :


Cheating not allowed !! 04
(unit?
unit=104&lesson=114)

Sorting and Searching :


20 questions game 01
(unit?
unit=104&lesson=115)

Sorting and Searching :


20 questions game 02
(unit?
unit=104&lesson=116)
True
Sorting and Searching : (2**90) % 2 == 0
20 questions game 03
3*((3**89) + 3 ) % 3 == 0
(unit?
unit=104&lesson=117) (2**90 ) % len(doors) == 1

Sorting and Searching : Yes, the answer is correct.


Score: 1
20 questions game 04
(unit?
Accepted Answers:
unit=104&lesson=118)
True
(2**90) % 2 == 0
Sorting and Searching : 3*((3**89) + 3 ) % 3 == 0
20 questions game 05
(2**90 ) % len(doors) == 1
(unit?
unit=104&lesson=119) 4) Given that you have a sorted list of 1024 elemets, what is the maximum number of comparisons required to find the target 1 point
element using binary search ? Also what is the number of comparisons to search such an element using linear search ?
Sorting and Searching :
20 questions game 06
Binary: 10, Linear: 512

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=104&assessment=462 3/7
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 8 - Week 5

(unit? Binary: 11, Linear: 1024


unit=104&lesson=120)
Binary: 10, Linear: 1024
Sorting and Searching :
Binary: 11, Linear: 512
20 questions game 07
(unit? No, the answer is incorrect.
unit=104&lesson=121) Score: 0
Accepted Answers:
Sorting and Searching : Binary: 10, Linear: 1024
20 questions game 08
(unit? 5) What type of data is contained in a file with a .wav or .wave extension? 1 point
unit=104&lesson=122)
Log data
Quiz: Week 5:
Audio data
Assignment 5
(assessment? Video data
name=462) Image data
Week 5: Programming Yes, the answer is correct.
Assignment 1 Score: 1
(/noc24_cs113/progassign Accepted Answers:
ment?name=464) Audio data

Week 5: Programming
6) What does this program print in the end ? 1 point
Assignment 2
(/noc24_cs113/progassign
ment?name=465)

Week 5: Programming
Assignment 3
(/noc24_cs113/progassign
ment?name=466)

Week 6 ()

Week 7 ()

Week 8 ()

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=104&assessment=462 4/7
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 8 - Week 5

Week 9 ()

Week 10 ()

Week 11 ()

Text Transcripts ()

Download Videos ()

Books ()

Problem Solving
Session - July 2024 ()

Fraction of throws where both players showed different symbol(rock/paper/scissors)


Fraction of throws where both players showed rock.
Fraction of throws where both players showed same symbol(rock/paper/scissors)
Fraction of throws where both players showed paper.

Yes, the answer is correct.


Score: 1
Accepted Answers:
Fraction of throws where both players showed same symbol(rock/paper/scissors)

7) In binary search, what happens if the target value is greater than the middle element of the array? 1 point

The search continues in the left half of the array.


The search continues in the right half of the array.
The search ends.
The array is sorted again.

Yes, the answer is correct.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=104&assessment=462 5/7
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 8 - Week 5

Score: 1
Accepted Answers:
The search continues in the right half of the array.

8) Which of the following is a requirement for binary search to work correctly? 1 point

The list must be sorted.


The list must contain only positive numbers.
The list must be of an even length.
The list must contain unique elements.

No, the answer is incorrect.


Score: 0
Accepted Answers:
The list must be sorted.

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

[3, 2, 4, 8, 5]
[3, 2, 4, 5, 8]
[2, 3, 4, 5, 8]
[3, 5, 2, 4, 8]

Yes, the answer is correct.


Score: 1
Accepted Answers:
[3, 2, 4, 5, 8]

10) How many swaps are performed in iteration 3 for bubble sorting list [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) 1

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=104&assessment=462 6/7
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 8 - Week 5

1 point

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=104&assessment=462 7/7
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 9 - Week 6

[email protected]

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

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

Announcements (announcements) About the Course (preview) Q&A (forum) Progress (student/home) Mentor (student/mentor)

Mentee List (student/mentee) Review Assignment (assignment_review) Course Recommendations (/course_recommendations)

Course outline Week 6: Assignment 6


The due date for submitting this assignment has passed.
About NPTEL () Due on 2024-09-04, 23:59 IST.

How does an NPTEL


online course work? ()
Assignment submitted on 2024-09-02, 11:56 IST
1) If n is a positive integer, what is the output of the function given input n, 1 point
Week 0 ()

Week 1 ()

Week 2 ()

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=124&assessment=467 1/6
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 9 - Week 6

Week 3 ()

week 4 ()

Week 5 ()

Week 6 ()

Substitution Cipher -The


science of secrecy (unit?
unit=124&lesson=125) Sum of numbers from 1 to n
Substitution Cipher -The Sum of numbers from 1 to n-1
science of secrecy 01 n-1
(unit?
n
unit=124&lesson=126)
Yes, the answer is correct.
Substitution Cipher -The Score: 1
science of secrecy 02
Accepted Answers:
(unit?
n
unit=124&lesson=127)
2) Which of the following are true about recursion? 1 point
Substitution Cipher -The
science of secrecy 03
Recursion is a process in which a function calls itself as a subroutine.
(unit?
unit=124&lesson=128) Recursion is a better alternative for performing repetitive tasks compared to iteration.
Recursion requires more resources compared to iteration.
Tic Tac Toe - Down the
memory Lane (unit? Yes, the answer is correct.
unit=124&lesson=129) Score: 1
Accepted Answers:
Tic Tac Toe - Down the Recursion is a process in which a function calls itself as a subroutine.
memory Lane 01 (unit?
Recursion requires more resources compared to iteration.
unit=124&lesson=130)

Tic Tac Toe - Down the 3) What is the output of following code ? 1 point
memory Lane 02 (unit?
unit=124&lesson=131)

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=124&assessment=467 2/6
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 9 - Week 6

Tic Tac Toe - Down the


memory Lane 03 (unit?
unit=124&lesson=132)

Tic Tac Toe - Down the


memory Lane 04 (unit?
unit=124&lesson=133)

Tic Tac Toe - Down the


memory Lane 05 (unit?
unit=124&lesson=134)

Recursion (unit?
unit=124&lesson=135)

Recursion 01 (unit?
unit=124&lesson=136) 10
Recursion 02 (unit? 8
unit=124&lesson=137) 5
Recursion 03 (unit? Error
unit=124&lesson=138)
Yes, the answer is correct.
Recursion 04 (unit?
Score: 1
unit=124&lesson=139) Accepted Answers:
8
Recursion 05 (unit?
unit=124&lesson=140) 4) The letter 'e' is the most frequently occurring letter in the English language. Suppose we apply a Substitution Cipher where 'e' is 1 point
mapped to 'a', and all other letters are uniquely mapped to different letters. If we encrypt a very long English storybook using this cipher, will the
Recursion 06 (unit?
frequency of 'a' be the highest in the encrypted text?
unit=124&lesson=141)

Quiz: Week 6: Hint: Search the internet for more info, if needed
Assignment 6
(assessment? Yes, it would be same as ’e’ in the original text
name=467) Yes, it would be higher than ’e’ in the original text.
Week 6: Programming No, it would be lower than ’e’ in the original text.
Assignment 1 No, we cannot predict

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=124&assessment=467 3/6
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 9 - Week 6

(/noc24_cs113/progassign Yes, the answer is correct.


ment?name=468) Score: 1
Accepted Answers:
Week 6: Programming Yes, it would be same as ’e’ in the original text
Assignment 2
(/noc24_cs113/progassign 5) Could we check frequency of letters in a long ciphertext and map them to frequency of letters in English to decrypt the message? 1 point
ment?name=470)
Hint: Search the internet for more info, if needed.
Week 6: Programming
Assignment 3
Yes, it is possible.
(/noc24_cs113/progassign
ment?name=471) No, it is not possible.

Yes, the answer is correct.


Week 6 Feedback Form:
Score: 1
The Joy of Computing
Accepted Answers:
using Python (unit?
Yes, it is possible.
unit=124&lesson=142)

Week 7 () 6) What are drawbacks of using frequency analysis to decrypt a message that has been encrypted using Substitution Cipher? 1 point

It will not work if the cipher text is too small.


Week 8 ()
It works flawlessly.
Week 9 () It will not work if the encrypted text was previously encrypted using a different cipher, which could have removed patterns in common
English.
Week 10 () The frequency analysis method doesn’t work at all for Substitution Cipher

Yes, the answer is correct.


Week 11 () Score: 1
Accepted Answers:
Text Transcripts () It will not work if the cipher text is too small.
It will not work if the encrypted text was previously encrypted using a different cipher, which could have removed patterns in common
Download Videos () English.

Books () 7) If variable dict name is a non-empty dictionary, what does dict name.keys() return? 1 point

Problem Solving Returns nothing, but prints all the keys in the dictionary.
Session - July 2024 () Returns a list of all the keys in the dictionary.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=124&assessment=467 4/6
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 9 - Week 6

Returns a list of all the values in the dictionary.


Returns a list of all the items in the dictionary

Yes, the answer is correct.


Score: 1
Accepted Answers:
Returns a list of all the keys in the dictionary.

8) Is Ceaser Cipher a type of Substitution Cipher? 1 point

Yes
No

Yes, the answer is correct.


Score: 1
Accepted Answers:
Yes

9) What is the consequence of not having a base case in a recursive function? 1 point

The function will run infinitely.


The function will run only once.
The function will not run at all.
The function will run only for a fixed number of times.

Yes, the answer is correct.


Score: 1
Accepted Answers:
The function will run infinitely.

10) What are the number of possible final lines when someone wins, in a game of TicTac-Toe? 1 point

3
8
9
4

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=124&assessment=467 5/6
10/3/24, 1:09 PM The Joy of Computing using Python - - Unit 9 - Week 6

Yes, the answer is correct.


Score: 1
Accepted Answers:
8

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=124&assessment=467 6/6
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 10 - Week 7

[email protected]

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

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

Announcements (announcements) About the Course (preview) Q&A (forum) Progress (student/home) Mentor (student/mentor)

Mentee List (student/mentee) Review Assignment (assignment_review) Course Recommendations (/course_recommendations)

Course outline Week 7: Assignment 7


The due date for submitting this assignment has passed.
About NPTEL () Due on 2024-09-11, 23:59 IST.

How does an NPTEL


online course work? ()
Assignment submitted on 2024-09-04, 13:36 IST
1) Which of the following methods is used to read the content of a CSV file in Python using the csv module? 1 point
Week 0 ()
csv.reader()
Week 1 () csv.write()
csv.load()
Week 2 ()
csv.readfile()

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=143&assessment=472 1/5
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 10 - Week 7

Yes, the answer is correct.


Week 3 () Score: 1
Accepted Answers:
week 4 () csv.reader()

2) Which command is used to install a Python package using pip? 1 point


Week 5 ()
pip install package-name
Week 6 ()
install pip package-name
python install package-name
Week 7 ()
pip package-name install
Snakes and Ladders - Not
Yes, the answer is correct.
on the Board (unit? Score: 1
unit=143&lesson=144)
Accepted Answers:
Snakes and Ladders - Not pip install package-name
on the Board - Part 01
(unit? 3) What is the primary purpose of the gmplot library in Python? 1 point
unit=143&lesson=145)
To create 3D plots
Snakes and Ladders - Not
on the Board - Part 02
To plot data on Google Maps
(unit? To generate matplotlib graphs
unit=143&lesson=146)
To create dashboards
Snakes and Ladders - Not Yes, the answer is correct.
on the Board - Part 03 Score: 1
(unit? Accepted Answers:
unit=143&lesson=147) To plot data on Google Maps

Snakes and Ladders - Not


on the Board - Part 04 4) In a game of Snakes and Ladders, a player is currently on square 96. There is a snake on square 99 that sends the player back to
(unit? square 78. If the player wishes to reach square 100 in one dice throw, what number must they roll on the dice?
unit=143&lesson=148)
4
Snakes and Ladders - Not
on the Board - Part 05 Yes, the answer is correct.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=143&assessment=472 2/5
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 10 - Week 7

(unit? Score: 1
unit=143&lesson=149) Accepted Answers:
(Type: Numeric) 4
Snakes and Ladders - Not
1 point
on the Board - Part 06
(unit? 5) In the same scenario, where the player is on square 96 and needs to roll a 4 to reach square 100, what is the probability of rolling 1 point
unit=143&lesson=150) this number on a fair six-sided die?
Spiral Traversing - Let's
1/2
Animate (unit?
unit=143&lesson=151) 1/3
1/4
Spiral Traversing - Let's
Animate - Part 01 (unit? 1/6
unit=143&lesson=152)
Yes, the answer is correct.
Spiral Traversing - Let's
Score: 1
Animate - Part 02 (unit? Accepted Answers:
unit=143&lesson=153) 1/6

Spiral Traversing - Let's


6) Which of the following commands will draw a square using Python’s turtle module? 1 point
Animate - Part 03 (unit?
Turtle is imported in the following way-
unit=143&lesson=154)
import turtle as t
Spiral Traversing - Let's turtle = t.Turtle()
Animate - Part 04 (unit?
unit=143&lesson=155) for i in range(4):
turtle.forward(100)
Spiral Traversing - Let's
turtle.left(90)
Animate - Part 05 (unit?
unit=143&lesson=156)
for i in range(4):
Spiral Traversing - Let's turtle.forward(100)
Animate - Part 06 (unit? turtle.right(90)
unit=143&lesson=157)

Spiral Traversing - Let's for i in range(4):


Animate - Part 07 (unit? turtle.backward(100)
unit=143&lesson=158) turtle.left(90)

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=143&assessment=472 3/5
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 10 - Week 7

GPS - Track the route


(unit? for i in range(4):
unit=143&lesson=159) turtle.backward(100)
turtle.right(90)
GPS - Track the route -
Part 01 (unit? Yes, the answer is correct.
unit=143&lesson=160) Score: 1
Accepted Answers:
GPS - Track the route - for i in range(4):
Part 02 (unit? turtle.forward(100)
unit=143&lesson=161)
turtle.left(90)
GPS - Track the route - for i in range(4):
Part 03 (unit? turtle.forward(100)
unit=143&lesson=162) turtle.right(90)
for i in range(4):
GPS - Track the route -
Part 04 (unit?
turtle.backward(100)
unit=143&lesson=163) turtle.left(90)
for i in range(4):
Quiz: Week 7: turtle.backward(100)
Assignment 7
turtle.right(90)
(assessment?
name=472) 7) Does the turtle module in Python allow you to draw complex shapes on the screen? 1 point

Week 7: Programming
Yes
Assignment 1
(/noc24_cs113/progassign No
ment?name=473) Yes, the answer is correct.
Score: 1
Week 7: Programming
Accepted Answers:
Assignment 2
Yes
(/noc24_cs113/progassign
ment?name=474)
8) What is the purpose of the turtle.penup() and turtle.pendown() commands in Python’s turtle module? 1 point
Week 7: Programming
Assignment 3 To stop the turtle from drawing and then resume drawing at a new position
(/noc24_cs113/progassign
To change the color of the turtle’s pen
ment?name=475)
To speed up or slow down the drawing speed of the turtle

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=143&assessment=472 4/5
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 10 - Week 7

Yes, the answer is correct.


Week 7 Feedback Form:
Score: 1
The Joy of Computing
Accepted Answers:
using Python (unit?
To stop the turtle from drawing and then resume drawing at a new position
unit=143&lesson=164)
9) What is the default drawing state of the turtle when a new turtle object is created in Python’s turtle module? 1 point
Week 8 ()
The turtle’s pen is up, so it does not draw while moving.
Week 9 () The turtle’s pen is down, so it draws while moving.
The turtle is hidden, so it does not appear on the screen.
Week 10 ()
The turtle starts with a circular shape.
Week 11 () Yes, the answer is correct.
Score: 1
Text Transcripts () Accepted Answers:
The turtle’s pen is down, so it draws while moving.
Download Videos ()
10) Which of the following commands is used to open an image file using Python’s PIL (Pillow) library? 1 point
Books ()
img = PIL.Image.open(’image.jpg’)
img = Image.open(’image.jpg’)
Problem Solving
Session - July 2024 () img = open_image(’image.jpg’)
img = PIL.open_image(’image.jpg’)

Yes, the answer is correct.


Score: 1
Accepted Answers:
img = Image.open(’image.jpg’)

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=143&assessment=472 5/5
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 11 - Week 8

[email protected]

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

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

Announcements (announcements) About the Course (preview) Q&A (forum) Progress (student/home) Mentor (student/mentor)

Mentee List (student/mentee) Review Assignment (assignment_review) Course Recommendations (/course_recommendations)

Course outline Week 8: Assignment 8


The due date for submitting this assignment has passed.
About NPTEL () Due on 2024-09-18, 23:59 IST.

How does an NPTEL


online course work? ()
Assignment submitted on 2024-09-16, 16:10 IST
1) Which of the following is a valid way to create a tuple in Python? 1 point
Week 0 ()
t = [1, 2, 3]
Week 1 () t = (1, 2, 3)
t = {1, 2, 3}
Week 2 ()
t = 1, 2, 3

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=165&assessment=480 1/5
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 11 - Week 8

Yes, the answer is correct.


Week 3 () Score: 1
Accepted Answers:
week 4 () t = (1, 2, 3)
t = 1, 2, 3
Week 5 ()
2) Which of the following operations is valid on a tuple? 1 point

Week 6 () t[1] = 4
t.append(4)
Week 7 ()
t = t + (4,)

Week 8 () del t[1]

Yes, the answer is correct.


Tuples- Python Data Score: 1
Structure (unit? Accepted Answers:
unit=165&lesson=166) t = t + (4,)
Lottery Simulation - Profit
or Loss (unit? 3) What will the following code output? 1 point
unit=165&lesson=167)
t = [1, 2, 3]
Lottery Simulation - Profit
print(type((t,t)))
or Loss - Part 01 (unit?
unit=165&lesson=168)
< class ’list’ >
Lottery Simulation - Profit
or Loss - Part 02 (unit? < class ’set’ >
unit=165&lesson=169)
< class ’tuple’ >
Lottery Simulation - Profit
or Loss - Part 03 (unit?
Error
unit=165&lesson=170) Yes, the answer is correct.
Score: 1
Lottery Simulation - Profit
Accepted Answers:
or Loss - Part 04 (unit?
< class ’tuple’ >
unit=165&lesson=171)

Lottery Simulation - Profit 4) What is the primary purpose of the matplotlib.pyplot module in Python? 1 point
or Loss - Part 05 (unit?

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=165&assessment=480 2/5
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 11 - Week 8

unit=165&lesson=172) To perform matrix operations.


Lottery Simulation - Profit To handle file I/O operations.
or Loss - Part 06 (unit?
To generate and customize visualizations like plots and graphs.
unit=165&lesson=173)
To manipulate and process images.
Image Processing -
Yes, the answer is correct.
Enhance your images
Score: 1
(unit?
Accepted Answers:
unit=165&lesson=174)
To generate and customize visualizations like plots and graphs.
Image Processing -
5) Which of the following statements is true about anagrams? 1 point
Enhance your images -
Part 01 (unit?
Two strings of different lengths can be anagrams.
unit=165&lesson=175)
Two strings are anagrams if they contain the same characters in the same order.
Image Processing -
Two strings are anagrams if they contain the same characters in different orders.
Enhance your images -
Part 02 (unit? Yes, the answer is correct.
unit=165&lesson=176) Score: 1
Accepted Answers:
Image Processing - Two strings are anagrams if they contain the same characters in different orders.
Enhance your images -
Part 03 (unit?
6) Every character, whether an alphabet, digit, or special character, has an ASCII value. Which of the following methods is used to 1 point
unit=165&lesson=177)
find the ASCII value ?
Anagrams (unit?
unit=165&lesson=178) ASCII(’a’)

Anagrams - Part 01 (unit? ord(’a’)


unit=165&lesson=179) int(’a’)

Anagrams - Part 02 (unit? ASC val(’a’)


unit=165&lesson=180) Yes, the answer is correct.
Score: 1
Anagrams - Part 03 (unit?
Accepted Answers:
unit=165&lesson=181)
ord(’a’)
Facebook Sentiment
Analysis (unit? 7) Which of the following libraries is commonly used to determine the intensity of emotions in sentiment analysis? 1 point
unit=165&lesson=182)

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=165&assessment=480 3/5
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 11 - Week 8

Facebook Sentiment VADER


Analysis - Part 01 (unit?
Numpy
unit=165&lesson=183)
Pandas
Facebook Sentiment
SciPy
Analysis - Part 02 (unit?
unit=165&lesson=184) Yes, the answer is correct.
Score: 1
Facebook Sentiment Accepted Answers:
Analysis - Part 03 (unit? VADER
unit=165&lesson=185)
8) Which of the following Python code snippets correctly checks if two strings are anagrams? 1 point
Facebook Sentiment
Analysis - Part 04 (unit? def are_anagrams(str1, str2):
unit=165&lesson=186) return sorted(str1) == sorted(str2)
Quiz: Week 8:
Assignment 8 def are_anagrams(str1, str2):
(assessment? return set(str1) == set(str2)
name=480)
def are_anagrams(str1, str2):
Week 8: Programming
return str1 == str2[::-1]
Assignment 1
(/noc24_cs113/progassign
def are_anagrams(str1, str2):
ment?name=476)
return len(str1) == len(str2)
Week 8: Programming
Yes, the answer is correct.
Assignment 2
Score: 1
(/noc24_cs113/progassign
Accepted Answers:
ment?name=478)
def are_anagrams(str1, str2):
Week 8: Programming return sorted(str1) == sorted(str2)
Assignment 3
(/noc24_cs113/progassign 9) Why is gambling generally a bad decision ? 1 point
ment?name=479)
Because you will lose more money than you win over time.
Week 8 Feedback Form:
The Joy of Computing Because the probability of winning is always 0.
using Python (unit? Because you will always win.
unit=165&lesson=187)

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=165&assessment=480 4/5
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 11 - Week 8

Week 9 () Because the amount of money you can win is always greater than the amount you lost over time

Yes, the answer is correct.


Week 10 () Score: 1
Accepted Answers:
Because you will lose more money than you win over time.
Week 11 ()
10) True or False: A significant amount of information can be extracted from an image by applying the appropriate image 1 point
Text Transcripts () enhancement techniques

Download Videos () True


False
Books ()
Yes, the answer is correct.
Score: 1
Problem Solving Accepted Answers:
Session - July 2024 () True

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=165&assessment=480 5/5
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 12 - Week 9

[email protected]

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

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

Announcements (announcements) About the Course (preview) Q&A (forum) Progress (student/home) Mentor (student/mentor)

Mentee List (student/mentee) Review Assignment (assignment_review) Course Recommendations (/course_recommendations)

Course outline Week 9: Assignment 9


The due date for submitting this assignment has passed.
About NPTEL () Due on 2024-09-25, 23:59 IST.

How does an NPTEL


online course work? ()
Assignment submitted on 2024-09-24, 12:07 IST
1) ‘nltk.download()‘ function downloads necessary packages for the Natural Language Toolkit (NLTK) library? 1 point
Week 0 ()
True
Week 1 () False

Yes, the answer is correct.


Week 2 ()

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=188&assessment=485 1/6
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 12 - Week 9

Score: 1
Week 3 () Accepted Answers:
True
week 4 ()
2) Which of the following best defines a complete graph? 1 point
Week 5 ()
A graph where every pair of distinct vertices is connected by a unique edge
A graph with no edges
Week 6 ()
A graph with a single vertex
Week 7 () A graph with at least one loop

Yes, the answer is correct.


Week 8 () Score: 1
Accepted Answers:
Week 9 () A graph where every pair of distinct vertices is connected by a unique edge

Natural Language
3) How many edges are there in a complete graph with 4 nodes? 1 point
Processing - Author
Stylometry (unit? 6
unit=188&lesson=189)
8
Natural Language
12
Processing - Author
Stylometry - Part 01 (unit? 16
unit=188&lesson=190) Yes, the answer is correct.
Score: 1
Natural Language
Accepted Answers:
Processing - Author
6
Stylometry - Part 02 (unit?
unit=188&lesson=191)
4) Which Python library is most commonly used for working with graphs related to networks? 1 point
Natural Language
Processing - Author Random
Stylometry - Part 03 (unit?
Pandas
unit=188&lesson=192)
NumPy
Natural Language
NetworkX
Processing - Author

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=188&assessment=485 2/6
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 12 - Week 9

Stylometry - Part 04 (unit? Yes, the answer is correct.


unit=188&lesson=193) Score: 1
Accepted Answers:
Natural Language NetworkX
Processing - Author
Stylometry - Part 05 (unit? 5) Gephi is: 1 point
unit=188&lesson=194)
A Python library for linear algebra
Natural Language
A software for visualizing and analyzing large networks
Processing - Author
Stylometry - Part 06 (unit? A tool for data cleaning and preprocessing
unit=188&lesson=195) A Python library for building statistical models
Natural Language Yes, the answer is correct.
Processing - Author Score: 1
Stylometry - Part 07 (unit? Accepted Answers:
unit=188&lesson=196) A software for visualizing and analyzing large networks

Natural Language
6) How many attributes typically define a color in digital representations? 1 point
Processing - Author
Stylometry - Part 08 (unit?
1
unit=188&lesson=197)
2
Natural Language
3
Processing - Author
Stylometry - Part 09 (unit? 9
unit=188&lesson=198)
Yes, the answer is correct.
Natural Language
Score: 1
Processing - Author Accepted Answers:
Stylometry - Part 10 (unit? 3
unit=188&lesson=199)
7) What is the degree of a node in a graph? 1 point
Introduction to Networkx -
Part 01 (unit? The number of edges connected to the node
unit=188&lesson=200)
The shortest path between two nodes
Introduction to Networkx -
The number of nodes in the graph
Part 02 (unit?
unit=188&lesson=201) The distance from the node to the center of the graph

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=188&assessment=485 3/6
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 12 - Week 9

Yes, the answer is correct.


Six Degrees of Separation
Score: 1
: Meet your favourites
Accepted Answers:
(unit?
The number of edges connected to the node
unit=188&lesson=202)
8) What is the primary goal of stylometry? 1 point
Six Degrees of Separation
: Meet your favourites -
To analyze the style and structure of literary works for authorship attribution
Part 01 (unit?
unit=188&lesson=203) To create stylized graphics for digital art
To study phonology of languages
Six Degrees of Separation
: Meet your favourites - To enhance the readability of texts by adjusting font styles
Part 02 (unit?
Yes, the answer is correct.
unit=188&lesson=204) Score: 1
Six Degrees of Separation Accepted Answers:
: Meet your favourites - To analyze the style and structure of literary works for authorship attribution
Part 03 (unit?
unit=188&lesson=205) 9) Given the following Python code, what is printed in the end? 1 point

Area Calculation - Don't


x = ["apple", "banana", "cherry", "date"]
Measure (unit?
unit=188&lesson=206)
k=0
for item in x:
Area Calculation - Don't k += len(item)
Measure - Part 01 (unit?
unit=188&lesson=207)
print(k)
Area Calculation - Don't
Measure - Part 02 (unit? 4
unit=188&lesson=208) 21

Area Calculation - Don't 24


Measure - Part 03 (unit? 26
unit=188&lesson=209)
Yes, the answer is correct.
Area Calculation - Don't Score: 1
Measure - Part 04 (unit? Accepted Answers:
unit=188&lesson=210) 21

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=188&assessment=485 4/6
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 12 - Week 9

Area Calculation - Don't 10) How can you estimate the area of a sub-region within a larger region by randomly throwing points in the larger region? 1 point
Measure - Part 05 (unit?
unit=188&lesson=211) By counting the total number of points and calculating the sum of their distances from the center
By calculating the proportion of points that land in the sub-region compared to the total number of points in the larger region
Area Calculation - Don't
Measure - Part 06 (unit? By calculating the distance between each point and the boundary of the region
unit=188&lesson=212) By averaging the coordinates of all the points that land in the larger region

Week 9 Feedback Form: Yes, the answer is correct.


The Joy of Computing Score: 1
using Python (unit? Accepted Answers:
unit=188&lesson=213) By calculating the proportion of points that land in the sub-region compared to the total number of points in the larger region

Quiz: Week 9:
Assignment 9
(assessment?
name=485)

Week 9: Programming
Assignment 1
(/noc24_cs113/progassign
ment?name=482)

Week 9: Programming
Assignment 2
(/noc24_cs113/progassign
ment?name=483)

Week 9: Programming
Assignment 3
(/noc24_cs113/progassign
ment?name=484)

Week 10 ()

Week 11 ()

Text Transcripts ()

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=188&assessment=485 5/6
10/3/24, 1:10 PM The Joy of Computing using Python - - Unit 12 - Week 9

Download Videos ()

Books ()

Problem Solving
Session - July 2024 ()

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=188&assessment=485 6/6
10/3/24, 1:11 PM The Joy of Computing using Python - - Unit 13 - Week 10

[email protected]

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

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

Announcements (announcements) About the Course (preview) Q&A (forum) Progress (student/home) Mentor (student/mentor)

Mentee List (student/mentee) Review Assignment (assignment_review) Course Recommendations (/course_recommendations)

Course outline Week 10: Assignment 10


The due date for submitting this assignment has passed.
About NPTEL () Due on 2024-10-02, 23:59 IST.

How does an NPTEL


online course work? ()
Assignment submitted on 2024-09-30, 08:06 IST
1) What will be the output of the following Python code? 1 point
Week 0 ()
s = "Hello, World!"
Week 1 () print (s[7:12 ])

Week 2 () "World"
"World!"

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=214&assessment=491 1/5
10/3/24, 1:11 PM The Joy of Computing using Python - - Unit 13 - Week 10

Week 3 () "Worl"
"orld"
week 4 () Yes, the answer is correct.
Score: 1
Week 5 () Accepted Answers:
"World"
Week 6 ()
2) Which string method would you use to remove all leading and trailing whitespace from a string in Python? 1 point

Week 7 () strip()
split()
Week 8 ()
replace()

Week 9 () join()

Yes, the answer is correct.


Week 10 () Score: 1
Accepted Answers:
FLAMES - Part 01 (unit? strip()
unit=214&lesson=215)
3) Given the string s = "PythonProgramming", what does s [::2] return? 1 point
FLAMES - Part 02 (unit?
unit=214&lesson=216)
"PythonProgramming"
FLAMES - Part 03 (unit? "Pto rgamn"
unit=214&lesson=217)
"PyonPormig"
FLAMES - Part 04 (unit? "PtoPormig"
unit=214&lesson=218)
Yes, the answer is correct.
FLAMES - Part 05 (unit? Score: 1
unit=214&lesson=219) Accepted Answers:
"PtoPormig"
FLAMES - Part 06 (unit?
unit=214&lesson=220)
4) Why are names often converted to lowercase and spaces removed when implementing the FLAMES game in Python? 1 point
Data Compression - Part
01 (unit? To increase game difficulty
unit=214&lesson=221)
To ensure consistent character comparison

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=214&assessment=491 2/5
10/3/24, 1:11 PM The Joy of Computing using Python - - Unit 13 - Week 10

Data Compression - Part Because uppercase letters are not supported in Python strings
02 (unit?
To encrypt the names for privacy
unit=214&lesson=222)
Yes, the answer is correct.
Data Compression - Part Score: 1
03 (unit? Accepted Answers:
unit=214&lesson=223) To ensure consistent character comparison

Data Compression - Part 5) Given the names "Alice" and "Bob", what is the FLAMES result of their relationship according to the FLAMES game? 1 point
04 (unit?
unit=214&lesson=224) Friends

Data Compression - Part Love


05 (unit? Affection
unit=214&lesson=225)
Marriage
Week 10 Feedback Form: Enemy
The Joy of Computing
Siblings
using Python (unit?
unit=214&lesson=226) Yes, the answer is correct.
Score: 1
Quiz: Week 10:
Accepted Answers:
Assignment 10
Affection
(assessment?
name=491)
6) Given a = np.array ([1, 2, 3, 4, 5]), what does print(a[1:4]) output? 1 point
Week 10: Programming
Assignment 1 [1 2 3]
(/noc24_cs113/progassign [2 3 4]
ment?name=486)
[2 3 4 5]
Week 10: Programming
[1 2 3 4]
Assignment 2
(/noc24_cs113/progassign Yes, the answer is correct.
ment?name=487)
Score: 1
Accepted Answers:
Week 10: Programming [2 3 4]
Assignment 3
(/noc24_cs113/progassign
7) In the NumPy array arr = np.array ( [ [1,2,3],[4,5,6],[7,8,9] ] ), what is the value of arr [1,2]? 1 point
ment?name=490)

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=214&assessment=491 3/5
10/3/24, 1:11 PM The Joy of Computing using Python - - Unit 13 - Week 10

Week 11 () 5
6
Text Transcripts () 2
8
Download Videos ()
Yes, the answer is correct.
Score: 1
Books ()
Accepted Answers:
6
Problem Solving
Session - July 2024 () 8) What is the output of the following Python code? 1 point

s = "abcdef"
print (s[1:5:2])

"bd"
"bcd"
"ace"
"be"

Yes, the answer is correct.


Score: 1
Accepted Answers:
"bd"

9) Can numpy be used when working with images in Python? 1 point

Yes
No
Yes, the answer is correct.
Score: 1
Accepted Answers:
Yes

10) When comparing lossy and lossless compression methods, which of the following statements is true? 1 point

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=214&assessment=491 4/5
10/3/24, 1:11 PM The Joy of Computing using Python - - Unit 13 - Week 10

Lossy compression reduces file size without any loss of quality.


Lossless compression reduces file size without any loss of quality.

Yes, the answer is correct.


Score: 1
Accepted Answers:
Lossless compression reduces file size without any loss of quality.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=214&assessment=491 5/5
10/16/24, 10:29 AM The Joy of Computing using Python - - Unit 14 - Week 11

(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)

Course Week 11: Assignment 11


outline The due date for submitting this assignment has passed.
Due on 2024-10-09, 23:59 IST.
About
NPTEL ()
Assignment submitted on 2024-10-03, 13:37 IST
How does an 1) Which Python library is commonly used for automating web browsers for tasks like 1 point
NPTEL testing or web scraping?
online
course datetime
work? () selenium
chrome
Week 0 ()
webdriver

Week 1 () Yes, the answer is correct.


Score: 1
Week 2 () Accepted Answers:
selenium

Week 3 ()
2) In Selenium, what is the purpose of the WebDriver (e.g., webdriver.Chrome())? 1 point
week 4 ()
To interact with databases
To send HTTP requests
Week 5 ()
To control a web browser programmatically
Week 6 () To parse HTML and XML documents

Yes, the answer is correct.


Week 7 () Score: 1
Accepted Answers:
Week 8 () To control a web browser programmatically

Week 9 () 3) Which method is used in Selenium to open a specific URL in the web browser? 1 point

driver.open(url)

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=227&assessment=499 1/4
10/16/24, 10:29 AM The Joy of Computing using Python - - Unit 14 - Week 11

Week 10 () driver.load(url)
driver.navigate(url)
Week 11 () driver.get(url)

Browser Yes, the answer is correct.


Score: 1
Automation
Accepted Answers:
Watsapp using
driver.get(url)
Python - Part
01 (unit? 4) In Selenium, how can you simulate pressing the Enter key in a text input field? 1 point
unit=227&less
on=228) input field.send keys(Keys.ENTER)
Browser input field.submit()
Automation input field.send keys(Keys.RETURN)
Watsapp using
Python - Part
input field.press(’Enter’)
02 (unit? No, the answer is incorrect.
unit=227&less Score: 0
on=229) Accepted Answers:
input field.send keys(Keys.RETURN)
Browser
Automation
Watsapp using 5) How can you get the current local date and time in Python using the datetime 1 point
Python - Part module?
03 (unit?
unit=227&less datetime.date.today()
on=230) datetime.datetime.now()

Browser datetime.time.now()
Automation
Yes, the answer is correct.
Watsapp using Score: 1
Python - Part Accepted Answers:
04 (unit? datetime.datetime.now()
unit=227&less
on=231)
6) Which function from the calendar module can be used to create a formatted string 1 point
Fun with representing a month’s calendar?
Calendar -
Part 01 (unit? calendar.printmonth()
unit=227&less calendar.month()
on=232)
calendar.monthcalendar()
Fun with
Yes, the answer is correct.
Calendar - Score: 1
Part 02 (unit?
Accepted Answers:
unit=227&less
calendar.month()
on=233)

Fun with 7) Which function would you use to replace characters in a string in Python? 1 point
Calendar -
Part 03 (unit? string.modify()
unit=227&less
string.replace(old, new)
on=234)
string.remove(old)
Fun with
string.update(new)
Calendar -
Part 04 (unit? Yes, the answer is correct.

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=227&assessment=499 2/4
10/16/24, 10:29 AM The Joy of Computing using Python - - Unit 14 - Week 11

unit=227&less Score: 1
on=235) Accepted Answers:
string.replace(old, new)
Fun with
Calendar - 8) Which of the following statements correctly imports the datetime module in Python? 1 point
Part 05 (unit?
unit=227&less import datetime
on=236) from datetime import datetime
Fun with import datetime as dt
Calendar -
All of the given options
Part 06 (unit?
unit=227&less Yes, the answer is correct.
on=237) Score: 1
Accepted Answers:
Fun with All of the given options
Calendar -
Part 07 (unit?
9) What does the following Python code output? 1 point
unit=227&less
on=238)
import calendar
Fun with print(calendar.isleap(2024))
Calendar -
Part 08 (unit? True
unit=227&less
False
on=239)
2024.0
Fun with
None
Calendar -
Part 09 (unit? Yes, the answer is correct.
unit=227&less Score: 1
on=240) Accepted Answers:
True
Fun with
Calendar -
10) Using the datetime module, how can you print the current date 7 times, each time 1 point
Part 10 (unit?
unit=227&less
increasing the day by 1 from the current date?
on=241)
for i in range(7):
Fun with print(datetime.datetime.now() + datetime.timedelta(days=i))
Calendar -
for i in range(7):
Part 11 (unit?
print(datetime.date.today() + datetime.timedelta(days=i))
unit=227&less
on=242) for i in range(7):
print(datetime.datetime.today().add(days=i))
Fun with
Calendar - for i in range(7):
Part 12 (unit? print(datetime.date.now().add(days=i))
unit=227&less Yes, the answer is correct.
on=243) Score: 1
Accepted Answers:
Quiz: Week
for i in range(7):
11:
Assignment print(datetime.date.today() + datetime.timedelta(days=i))
11
(assessment?
name=499)

Week 11:
Programming

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=227&assessment=499 3/4
10/16/24, 10:29 AM The Joy of Computing using Python - - Unit 14 - Week 11

Assignment 1
(/noc24_cs113
/progassignme
nt?name=493)

Week 11:
Programming
Assignment 2
(/noc24_cs113
/progassignme
nt?name=495)

Week 11:
Programming
Assignment 3
(/noc24_cs113
/progassignme
nt?name=496)

Week 11
Feedback
Form: The Joy
of Computing
using Python
(unit?
unit=227&less
on=244)

Week 12 ()

Text
Transcripts
()

Download
Videos ()

Books ()

Problem
Solving
Session -
July 2024 ()

https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=227&assessment=499 4/4
The Joy of Computing using Python - - Unit 15 - Week 12 https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=245&assessme...

(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)

Course Week 12: Assignment 12


outline The due date for submitting this assignment has passed.
Due on 2024-10-16, 23:59 IST.
About NPTEL
()
Assignment submitted on 2024-10-16, 10:55 IST
How does an 1) What is the key operation performed when the number n in the Collatz Conjecture is 1 point
NPTEL online even?
course work?
() Add 1
Multiply by 3 and add 1
Week 0 () Divide by 2
Subtract 1
Week 1 ()
Yes, the answer is correct.
Score: 1
Week 2 ()
Accepted Answers:
Divide by 2
Week 3 ()
2) What happens to an odd number n in the Collatz Conjecture sequence? 1 point
week 4 ()
It is divided by 2
It remains unchanged
Week 5 ()

It is replaced by n × 3 + 1
Week 6 ()

It is replaced by n − 1
Week 7 ()
Yes, the answer is correct.
Score: 1
Week 8 ()
Accepted Answers:
It is replaced by n × 3 + 1

1 of 5 17-10-2024, 10:25 am
The Joy of Computing using Python - - Unit 15 - Week 12 https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=245&assessme...

3) What is the ultimate goal of the Collatz Conjecture sequence? 1 point


Week 9 ()
Reach the number 0
Week 10 () Return to the starting number
Reach the number 1
Week 11 ()
Cycle through odd numbers

Week 12 () Yes, the answer is correct.


Score: 1
Page Rank - Accepted Answers:
How does Reach the number 1
Google Work ?
4) Which of the following best describes the Collatz Conjecture? 1 point
- Part 01 (unit?
unit=245&lesso
It has been proven for all natural numbers
n=246)
It remains an unsolved problem in mathematics
Page Rank - It is a trivial problem with a simple solution
How does
It only applies to prime numbers
Google Work ?
- Part 02 (unit? Yes, the answer is correct.
unit=245&lesso Score: 1
n=247) Accepted Answers:
It remains an unsolved problem in mathematics
Page Rank -
How does 5) What is the main idea behind the PageRank algorithm used by Google? 1 point
Google Work ?
- Part 03 (unit? Count the number of keywords on a page
unit=245&lesso Rank pages based on random walks on a graph of web links
n=248)
Rank pages based on user reviews
Page Rank - Rank pages alphabetically
How does
Yes, the answer is correct.
Google Work ?
Score: 1
- Part 04 (unit?
Accepted Answers:
unit=245&lesso
Rank pages based on random walks on a graph of web links
n=249)
6) In PageRank, what happens when a page has a higher number of inbound links from 1 point
Page Rank -
other important pages?
How does
Google Work ?
Its rank decreases due to the load on the server
- Part 05 (unit?
unit=245&lesso Its rank increases
n=250) Its rank remains unchanged
It is marked as a less relevant page
Page Rank -
How does Yes, the answer is correct.
Google Work ? Score: 1
- Part 06 (unit? Accepted Answers:
unit=245&lesso Its rank increases
n=251)
7) Which technique is used in the PageRank algorithm to determine the rank of a web 1 point
Page Rank - page?
How does
Google Work ? Depth-first search
- Part 07 (unit? Hyperlink analysis

2 of 5 17-10-2024, 10:25 am
The Joy of Computing using Python - - Unit 15 - Week 12 https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=245&assessme...

unit=245&lesso Random walk simulation


n=252)
Data scraping
Page Rank -
No, the answer is incorrect.
How does Score: 0
Google Work ? Accepted Answers:
- Part 08 (unit? Random walk simulation
unit=245&lesso
n=253) 8) PageRank relies heavily on the structure of the: 1 point

Page Rank - Web page content


How does
Hyperlink network between web pages
Google Work ?
- Part 09 (unit?
User interaction data
unit=245&lesso Server location
n=254)
Yes, the answer is correct.
Page Rank -
Score: 1
How does Accepted Answers:
Google Work ? Hyperlink network between web pages
- Part 10 (unit?
9) PageRank was developed primarily to solve which problem? 1 point
unit=245&lesso
n=255) Calculating the shortest path in a network
Page Rank - Ranking the importance of web pages on the internet
How does Counting the total number of web pages
Google Work ? Reducing the size of search engine databases
- Part 11 (unit?
unit=245&lesso Yes, the answer is correct.
n=256) Score: 1
Accepted Answers:
Page Rank - Ranking the importance of web pages on the internet
How does
Google Work ? 10) For which values between 200 and 3000 does the Collatz Conjecture not converge to 1 point
- Part 12 (unit? 1?
unit=245&lesso
n=257) 2498.0
1576.0
Page Rank -
How does
2789.0
Google Work ? None of the given options
- Part 13 (unit?
Yes, the answer is correct.
unit=245&lesso Score: 1
n=258)
Accepted Answers:
Page Rank - None of the given options
How does
Google Work ?
- Part 14 (unit?
unit=245&lesso
n=259)

Page Rank -
How does
Google Work ?
- Part 15 (unit?

3 of 5 17-10-2024, 10:25 am
The Joy of Computing using Python - - Unit 15 - Week 12 https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=245&assessme...

unit=245&lesso
n=260)

Page Rank -
How does
Google Work ?
- Part 16 (unit?
unit=245&lesso
n=261)

Collatz
Conjecture -
Part 01 (unit?
unit=245&lesso
n=262)

Collatz
Conjecture -
Part 02 (unit?
unit=245&lesso
n=263)

JOC
Conclusion
(unit?
unit=245&lesso
n=264)

Quiz: Week 12:


Assignment
12
(assessment?
name=500)

Week 12:
Programming
Assignment 1 (/
noc24_cs113/
progassignmen
t?name=494)

Week 12:
Programming
Assignment 2 (/
noc24_cs113/
progassignmen
t?name=497)

Week 12:
Programming
Assignment 3 (/
noc24_cs113/
progassignmen
t?name=498)

Week 12

4 of 5 17-10-2024, 10:25 am
The Joy of Computing using Python - - Unit 15 - Week 12 https://onlinecourses.nptel.ac.in/noc24_cs113/unit?unit=245&assessme...

Feedback
Form: The Joy
of Computing
using Python
(unit?
unit=245&lesso
n=265)

Text
Transcripts ()

Download
Videos ()

Books ()

Problem
Solving
Session -
July 2024 ()

5 of 5 17-10-2024, 10:25 am

You might also like