nerdexam
Cisco

350-401 · Question #1070

Refer to the exhibit. What is the output of this code?

The correct answer is A. 1st_item#######: 645298791871446. The Python code performs string slicing on a numeric string and concatenates a specific portion of it with a predefined prefix.

Submitted by deeparc· Mar 6, 2026Automation and Programmability

Question

Refer to the exhibit. What is the output of this code?

Exhibits

350-401 question #1070 exhibit 1
350-401 question #1070 exhibit 2

Options

  • A1st_item#######: 645298791871446
  • B1st_item#######: 6452987918
  • C1st_item#######: 8791871446
  • D645298791871446

How the community answered

(45 responses)
  • A
    76% (34)
  • B
    4% (2)
  • C
    7% (3)
  • D
    13% (6)

Why each option

The Python code performs string slicing on a numeric string and concatenates a specific portion of it with a predefined prefix.

A1st_item#######: 645298791871446Correct

The `long_number` string is '645298791871446'. The slice `long_number[1:]` extracts all characters from index 1 (the second character, which is '4') to the end, resulting in '45298791871446'. The print statement then concatenates '1st_item#######: 6' with this sliced string, yielding the final output '1st_item#######: 645298791871446'.

B1st_item#######: 6452987918

The slice `long_number[1:]` starts from '4', not implicitly including '6', and the result '6452987918' is an incorrect length for the slice combined with the prefix.

C1st_item#######: 8791871446

The slice `long_number[1:]` results in '45298791871446', not '8791871446', indicating an incorrect starting index for the slice.

D645298791871446

This option shows only the original `long_number` string without applying the string slicing or the prefix concatenation performed by the Python code.

Concept tested: Python string slicing and concatenation

Source: https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str

Topics

#Python scripting#Code interpretation#String manipulation

Community Discussion

No community discussion yet for this question.

Full 350-401 Practice