QuestenaՎարժանք, որը ցույց է տալիս՝ ինչ կրկնել հաջորդիվ
Հարց 101

With a positive slice step, what region does text[:] request when both bounds are omitted?

  1. The full sequence from beginning to endՃիշտ պատասխան
  2. An empty region because both bounds become zero
  3. Only the final element
  4. Everything except the final two elements

Բացատրություն

For forward slicing, the absent start means the beginning and the absent stop means the end, so the slice spans the whole string. Treating both omissions as zero would incorrectly make the request empty.

Շարունակեք այս թեստով

Սկսել վարժանքը
Հարց 101: With a positive slice step, what region does text[:]… · Python Fundamentals · Questena