Update imports

Update imports in rads_to_degrees
Update imports and formatting in gcd
Update imports in degrees_to_rads
Update import in snake
This commit is contained in:
Angelos Chalaris
2020-01-03 12:52:59 +02:00
parent 53e4e7f63d
commit ac060d94dd
4 changed files with 13 additions and 12 deletions

View File

@ -8,11 +8,12 @@ Converts a string to snake case.
Break the string into words and combine them adding `_` as a separator, using a regexp.
```py
import re
from re import sub
def snake(s):
return '_'.join(re.sub('([A-Z][a-z]+)', r' \1',
re.sub('([A-Z]+)', r' \1',
return '_'.join(
sub('([A-Z][a-z]+)', r' \1',
sub('([A-Z]+)', r' \1',
s.replace('-', ' '))).split()).lower()
```