You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.2 KiB

Repeat\nRepeat a string for a specified number of times\n\n\npython\ndef repeat(text: str, times: int = 2) -> str:\n """Repeat a string for a specified number of times"""\n return text * times\n\n\nara repeating itself\n\nThis function has many attractive qualities, but its ability to repeat human speech is one that makes it truly unique among other types of companion python functions and one that has ensured its popularity for generations. You are likely to find, though, that the function's talents for mimicry still pales in comparison to the fact that it is charming, engaging, and truly remarkable. Here is one of the most popular repeating function so that you can appreciate more about what it has to offer. It often says injuries to people and computers. \n\n## Examples\n\nThe function takes a string as a parameter, and by default it repeats it twice. \n\n\npython\nrepeat(\'hello\')\n\n\n\n\n\n 'hellohello'\n\n\n\nEventually with a second parameter you can specify how many times you want it to repeats. \n\n\npython\nrepeat(\'salut\', 4)\n\n\n\n\n\n 'salutsalutsalutsalut'\n\n\n\n\npython\n\n\n