NoSequenceRepetition
DRAFT

Misconception:

Python has no operator that would allow expressions to repeat a given sequence a given number of times. E.g., "Ciao! " * 3 is not a legal Python expression.

Incorrect

There is no operator that repeats sequences

Correct

Correction
Here is what's right.

In Python, the multiplication operator can be used to multiply a sequence by a number. The result of such an expression is a new sequence that corresponds to the given sequence repeated the given number of times.

Here is an example:

print("Ciao! " * 3)

# outputs Ciao! Ciao! Ciao!

Stay up-to-date

Follow us on  twitter to hear about new misconceptions.