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

If `text = "cat"`, what type does the expression `text[1]` return?

  1. `int`
  2. `bytes`
  3. A distinct `char` type
  4. `str`Ճիշտ պատասխան

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

Indexing selects the one-character string `a`, whose type is still `str`. Python has no separate built-in character type here, and indexing text does not expose an integer code point.

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

Սկսել վարժանքը
Հարց 16: If `text = "cat"`, what type does the expression `text[1]`… · Python Fundamentals · Questena