add n_times_string snippet
This commit is contained in:
23
README.md
23
README.md
@@ -117,6 +117,7 @@
|
||||
* [`decapitalize`](#decapitalize)
|
||||
* [`is_anagram`](#is_anagram)
|
||||
* [`kebab`](#kebab)
|
||||
* [`n_times_string`](#n_times_string)
|
||||
* [`palindrome`](#palindrome)
|
||||
* [`snake`](#snake)
|
||||
* [`split_lines`](#split_lines)
|
||||
@@ -1787,6 +1788,28 @@ kebab('AllThe-small Things'); # "all-the-small-things"
|
||||
|
||||
<br>[⬆ Back to top](#contents)
|
||||
|
||||
### n_times_string
|
||||
|
||||
Prints out the same string a defined number of times.
|
||||
|
||||
Use this method to print out the same string n number of times.
|
||||
|
||||
|
||||
```py
|
||||
def n_times_string(string,n):
|
||||
return (string * n)
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```py
|
||||
n_times_string('py', 4) #'pypypypy'
|
||||
```
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#contents)
|
||||
|
||||
### palindrome
|
||||
|
||||
Returns `True` if the given string is a palindrome, `False` otherwise.
|
||||
|
||||
Reference in New Issue
Block a user