Merge pull request #25 from arpit1997/master

fix: snippets reserved name shadowing
This commit is contained in:
Rohit Tanwar
2018-04-12 21:21:15 +05:30
committed by GitHub
3 changed files with 5 additions and 6 deletions

View File

@ -5,8 +5,8 @@ Checks if a string is lower case.
Convert the given string to lower case, using `str.lower()` method and compare it to the original.
```python
def is_lower_case(str):
return str == str.lower()
def is_lower_case(string):
return string == string.lower()
```
```python

View File

@ -5,8 +5,8 @@ Checks if a string is upper case.
Convert the given string to upper case, using `str.upper()` method and compare it to the original.
```python
def is_upper_case(str):
return str == str.upper()
def is_upper_case(string):
return string == string.upper()
```
```python

View File

@ -10,8 +10,7 @@ from copy import deepcopy
def max_n(arr, n=1):
numbers = deepcopy(arr)
numbers.sort()
numbers.reverse()
numbers.sort(reverse=True)
return numbers[:n]
```