Created
October 12, 2022 13:55
-
-
Save RaMSFT/82985e1393de3ea90bf1caa567af34a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def text_repetition(txt, reps): | |
| """returns repeated text | |
| Args: | |
| txt (string) | |
| reps (number) | |
| Returns: | |
| string: given string is repeated upto given number of times | |
| """ | |
| #multiplication operator repeats the string | |
| result = txt * reps | |
| return result | |
| print(text_repetition("ab", 3)) | |
| print(text_repetition("ram", 10)) | |
| print(text_repetition("kiwi", 4)) | |
| print(text_repetition("edabit", 2)) | |
| print(text_repetition("medium", 4)) | |
| print(text_repetition("python", 10)) | |
| print(text_repetition("learn", 5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment