Question 1easymultiple choice
Study the full Python automation breakdown →200-901 Software Development and Design • Complete Question Bank
Complete 200-901 Software Development and Design question bank — all 0 questions with answers and detailed explanations.
Given the following Python code snippet:
with open('config.json', 'r') as f:data = json.load(f)
print(data['interfaces'][0]['name'])
What is the expected output if config.json contains {"interfaces": [{"name": "GigabitEthernet0/1"}]}?
What is the output of the following code?
my_list = [1, 2, 3]
for i in range(len(my_list)):
my_list[i] += 1
print(my_list)
A Python function is defined as:
def process(*args, **kwargs):
return sum(args) + kwargs.get('offset', 0)What is the result of process(1, 2, 3, offset=10)?
Which Python exception would be raised by the following code?
my_dict = {'a': 1} value = my_dict['b']