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_upper_case.md Normal file
View File

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