Merge pull request #25 from arpit1997/master
fix: snippets reserved name shadowing
This commit is contained in:
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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]
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user