NPTEL The Joy of Computing using Python Week 11 Assignment Answers 2024
1. Select the correct statement regarding selenium library
- Selenium is primarily used for web browser automation
- The web driver in selenium allows a way to interact with web browsers
- The Keys Class provides a set of special keys that can be used for keyboard interaction
- All of the above
Answer: d
Explanation: All the statements are true. Selenium automates browsers, WebDriver is the API to interact with browsers, and the Keys class provides keyboard interaction support.
2. Which of the following tasks in WhatsApp can be automated using selenium?
- Sending Media Files
- Reading Messages
- Creating and Managing Groups
- Updating Profile Information
Answer: a, b, c, d
Explanation: Selenium can interact with WhatsApp Web and automate these actions, depending on the implementation. However, automation might be limited by WhatsApp’s internal protections or dynamic loading.
3. Read the given code and identify the correct statement.

- does_something returns a list of all time zones in Asia
- the above code prints all time zones in Asia
- The output of the code can change depending on the version of pytz used
- All of the above
Answer: d
Explanation: All options are valid. The function deals with time zones, and results might vary with pytz updates or regional adjustments.
4. Read the given code. What is the output of does_something(2022,2,29).(NAT)
Answer: 0
Explanation: February 29 does not exist in 2022 (not a leap year), so likely returns a default value like 0 or throws an error. Based on the answer, it’s handled and returns 0.
5. Read the given code.

Assume the file years.txt contains the following data.

What is the output of the code (NAT)
Answer: 2
Explanation: Without exact code and file contents, we assume the logic counts or filters something and outputs 2.
6. Read the given code.

Enter the value of int(count_something(1996)==count_something(2024))
Answer: 1
Explanation: If both function calls return the same value, comparison returns True
, which when converted to int()
becomes 1
.
7. Read the given code.

Enter the value returned by count_(1990,2024)
Answer: 9
Explanation: The function likely counts something between those years (e.g., leap years), and the output is 9.
8. The following code tries to calculate the date of “MiSeDol”, but the code might contain errors. Identify the line number corresponding to the error. In the absence of an error answer -1.
Answer: -1
Explanation: No error is found in the logic; hence, the answer is -1.
9. Read the given code. Find the value returned by finds_something (2000,12)
Answer: 5
Explanation: Likely related to calendar or month-based logic; function returns 5 for inputs 2000 and 12.
10. Read the following code. What does count_something(2024,1) return?
Answer: 23
Explanation: Possibly counts specific days/events in Jan 2024. Output is 23, maybe weekdays or working days.