nerdexam
Juniper

JN0-222 · Question #84

Exhibit Referring to the exhibit, what is the output from the print(x) line?

The correct answer is A. ['b', 'c']. Python 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> my_list = ["a", "b", "c", "d", "e", "f", "g"] >>> x = my_list[1:3]

Python

Question

Exhibit Referring to the exhibit, what is the output from the print(x) line?

Exhibit

JN0-222 question #84 exhibit

Options

  • A['b', 'c']
  • B['b', 'c', 'd']
  • C['a', 'b', 'c']
  • D['a', 'b']

How the community answered

(48 responses)
  • A
    71% (34)
  • B
    10% (5)
  • C
    4% (2)
  • D
    15% (7)

Explanation

Python 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> my_list = ["a", "b", "c", "d", "e", "f", "g"] >>> x = my_list[1:3]

Topics

#Python#list slicing#indexing#data types

Community Discussion

No community discussion yet for this question.

Full JN0-222 Practice