D522 Python for IT Automation - Set 3 - Part 1
Test your knowledge of technical writing concepts with these practice questions. Each question includes detailed explanations to help you understand the correct answers.
Question 1: What is exception handling used for in Python?
Question 2: Which block contains code that might raise an exception?
Question 3: Which keyword handles an exception in Python?
Question 4: Which block always runs whether or not an exception occurs?
Question 5: Which keyword explicitly raises an exception?
Question 6: What exception is raised when dividing by zero?
Question 7: What exception is raised when accessing a nonexistent dictionary key?
Question 8: What exception is raised when accessing a list index out of range?
Question 9: What exception is raised by int('abc')?
Question 10: What exception is raised when a file to be opened does not exist?
Question 11: Why should you catch specific exceptions rather than a bare except?
Question 12: What is a list comprehension in Python?
Question 13: What does [x for x in range(5)] produce?
Question 14: How do you add a condition to a list comprehension?
Question 15: What is a dictionary comprehension?
Question 16: What is a lambda function in Python?
Question 17: What does the map() function do?
Question 18: What does the filter() function do?
Question 19: What does the sorted() function return?
Question 20: How do you sort a list in place?
Need Guaranteed Results?
Our exam support service guarantees you'll pass your OA on the first attempt. Pay only after you pass!
Get Exam Support