nerdexam
Cisco

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.

Software Development and Design

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

200-901 question #366 exhibit 1
200-901 question #366 exhibit 2
200-901 question #366 exhibit 3
200-901 question #366 exhibit 4

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)
  • A
    81% (38)
  • B
    2% (1)
  • C
    11% (5)
  • D
    6% (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.

A77 query_string_params = {'platformId': 'AIR-API141N-A-K9'}Correct

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.

B21 print(item['id'], item['hostname']

The line `21 print(item['id'], item['hostname']` is not explicitly shown in the provided diff as either an added or unchanged line.

C24 print(item['id'], item['hostname'], item['managementIpAddress'])

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.

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)

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

#Unified diff#Code comparison#Python scripting#Version control basics

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice