repetition

Making a longer string or list by repeating one with *, as in "-" * 10.

In more detail

The count must be an integer, and either order works: 3 * "ab" gives "ababab". The same symbol means multiplication for numbers, which is why the type of each operand matters.

Example

"ha" * 3   # "hahaha"

Related terms

Taught in

References

Certification courses