new snippets

This commit is contained in:
Rohit Tanwar
2018-02-01 13:49:59 +05:30
parent b5a1fa18ba
commit 55f39b14bd
27 changed files with 292 additions and 34 deletions

16
snippets/is_lower_case.md Normal file
View File

@ -0,0 +1,16 @@
### is_lower_case
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()
```
```python
is_lower_case('abc') # True
is_lower_case('a3@$') # True
is_lower_case('Ab4') # False
```