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

What is the value of `"ab" * 3`?

  1. `abbb`
  2. `ababab`Ճիշտ պատասխան
  3. `ab3`
  4. A TypeError is raised.

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

Multiplication by the nonnegative integer repeats the complete string three times, producing `ababab`. It does not repeat only the ending character, and this combination of operand types is valid.

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

Սկսել վարժանքը
Հարց 18: What is the value of `"ab" * 3`? · Python Fundamentals · Questena