200-901 · Question #366
Refer to the exhibit. An engineer is comparing two files by using the unified diff format. Which cade snippet belongs to the new.py file? A. B. C. D.
The correct answer is A. 77 query_string_params = {'platformId': 'AIR-API141N-A-K9'}. In a unified diff, lines prefixed with + are present in the new.py file, indicating they were added or modified from the old.py file.
Question
Refer to the exhibit. An engineer is comparing two files by using the unified diff format. Which cade snippet belongs to the new.py file? A. B. C. D.
Exhibits
Options
- A77 query_string_params = {'platformId': 'AIR-API141N-A-K9'}
- B21 print(item['id'], item['hostname']
- C24 print(item['id'], item['hostname'], item['managementIpAddress'])
- D66 # print devices list filtered by hostname 67 print('\nPrinting device list filtered by hostname...') 68 query_string_params = {'hostname': 'CSBIKO-01.devnet.local'} 69 response = get_devices_list (headers, query_string_params) 70 print_devices_info(response)
How the community answered
(47 responses)- A81% (38)
- B2% (1)
- C11% (5)
- D6% (3)
Why each option
In a unified diff, lines prefixed with `+` are present in the `new.py` file, indicating they were added or modified from the `old.py` file.
The line `query_string_params = {'platformId': 'AIR-API141N-A-K9'}` is preceded by a `+` in the unified diff exhibit. This `+` symbol signifies that this specific line is an addition or a modification present only in the `new.py` file.
The line `21 print(item['id'], item['hostname']` is not explicitly shown in the provided diff as either an added or unchanged line.
The line `24 print(item['id'], item['hostname'], item['managementIpAddress'])` is not explicitly shown in the provided diff as either an added or unchanged line.
While parts of this snippet are in `new.py`, the lines `query_string_params = {'hostname': 'CSBIKO-01.devnet.local'}` and subsequent lines are shown as both removed and re-added, which is less directly indicative of a unique addition compared to option A.
Concept tested: Unified diff format interpretation
Source: https://git-scm.com/docs/git-diff#_combined_diff_format
Topics
Community Discussion
No community discussion yet for this question.



