NPTEL The Joy of Computing using Python Week 11 Assignment Answers 2025
1. In Selenium, what is the purpose of WebDriver, such as webdriver.Chrome()?
- It is used to interact with web elements like buttons and text fields.
- It launches and controls a web browser session for automation.
- It is used to write test cases in Selenium.
- It provides built-in methods to handle databases in web applications.
Answer :- For Answers Click Here
2. Which of the following is the best locator strategy in Selenium in terms of performance?
- find_element_by_name()
- find_element_by_id()
- find_element_by_class_name()
- find_element_by_xpath()
Answer :-
3. Selenium WebDriver can be used to automate both web and native mobile applications on Android and iOS.
- True
- False
Answer :-
4. What is the output of the following Python code?
- (0, 0) (0, 1) (1, 0) (1, 1) (2, 0) (2, 1) (4, 0) (4, 1)
- (0, 0) (0, 1) (1, 0) (1, 1) (2, 0) (2, 1) (3, 0) (3, 1) (4, 0) (4, 1)
- (0, 0) (0, 1) (1, 0) (1, 1) (2, 0) (2, 1) (3, 0) (3, 1) (3, 2) (4, 0) (4, 1)
- (0, 0) (0, 1) (1, 0) (1, 1) (2, 0) (2, 1) (3, 0) (4, 0) (4, 1) (4, 2)
Answer :-
5. What will be the output of the following Python code, which performs a modified linear search?
- Checking 3
Checking 8
Checking 1
Found at index 3 - Checking 3
Checking 1
Found at index 3 - Checking 3
Checking 8
Checking 1
Checking 7
Found at index 3 - Found at index 3
Answer :- For Answers Click Here
6. What does calendar.isleap(2100) return?
- False
- True
- None
- 1
Answer :-
7. What is the output of datetime.date(2024, 2, 29) + datetime.timedelta(days=1)?
- 2024-02-30
- 2024-03-01
- ValueError
- 2024-02-29
Answer :-
8. Which function is used to get the current local time in Python?
- time.localtime()
- datetime.now()
- time.time()
- datetime.utcnow()
Answer :-
9. What happens when you apply .astimezone() to a naive datetime object?
- It changes to UTC
- It raises an error
- It assumes local timezone
- It converts to IST
Answer :-
10. What is the output of the following Python code?
- 2024-02-29 12:00:00 IST
- 2024-02-29 06:30:00 UTC
- 2024-02-29 12:00:00 UTC
- Error
Answer :- For Answers Click Here