The Joy of Computing Using Python NPTEL Week 10 Answers

Are you looking for The Joy of Computing Using Python NPTEL Week 10 Answers? You’ve come to the right place! Access the latest and most accurate solutions for your Assignment 10 in The Joy of Computing Using Python course



The Joy of Computing Using Python NPTEL Week 10 Answers (Jan-Apr 2025)

Course Link: Click Here


1. Which of the following statements is correct about Python’s dynamic typing?

a) Variables must be declared before use.
b) A variable’s type can change at runtime.
c) Python does not allow reassignment of variable types.
d) Python is statically typed.

View Answer


2. What will be the output of the following code?

a) toPmiagmnrh
b) toPmiagmnrPg
c) tnoaigmooP
d) toPmiagmnr

View Answer


3. What does the following code print?

a) 6
b) 7
c) 9
d) Value Error

View Answer


4. Which statement about find() and index() in Python is true?

a) Both return -1 if the substring is not found.
b) index() raises an error if not found, but find() returns -1.
c) index() and find() behave identically.
d) Both return the first index of occurrence.

View Answer


5. What will be the output of the following Python code?

print(17 % -5)

a) 3
b) 2
c) 0
d) -3

View Answer


6. Which method in PIL is used to resize an image while maintaining the aspect ratio?

a) resize()
b) thumbnail()
c) reshape()
d) aspect ratio resize()

View Answer


These are The Joy of Computing Using Python NPTEL Week 10 Answers


7. Which of the following correctly finds all numbers divisible by 3 but not by 5 in a list?

nums = range(1, 50)

a) [x for x in nums if x % 3 == 0 and x % 5 != 0]
b) [x for x in nums if x % 5 != 0 or x % 3 == 0]
c) [x for x in nums if x % 3 != 0 and x % 5 == 0]
d) filter(lambda x: x % 3 == 0 and x % 5 == 0, nums)

View Answer


8. What will be the output of the following code?

a) 2
b) 5
c) [5, 6]
d) 4

View Answer


9. For which value of axis the output is [5, 7, 9] in the below code?

a) 0
b) 1
c) 2
d) axis argument is not required.

View Answer


10. What will be the shape of the resulting NumPy array?

a) (3, 2)
b) (4, 3)
c) (3, 4)
d) (4, 2)

View Answer


These are The Joy of Computing Using Python NPTEL Week 10 Answers

All Weeks of The Joy of Computing Using Python: Click here

For answers to additional Nptel courses, please refer to this link: NPTEL Assignment Answers