Skip to content

Commit 145ffe0

Browse files
authored
psf/black " not '
1 parent f8ae23b commit 145ffe0

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

strings/swap_case.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''
1+
"""
22
This algorithm helps you to swap cases.
33
44
User will give input and then program will perform swap cases.
@@ -10,12 +10,11 @@
1010
2)>>> Please input sentence: github.com/mayur200
1111
GITHUB.COM/MAYUR200
1212
13-
'''
13+
"""
1414
import re
15-
'''
16-
This re.compile() function saves the pattern from 'a' to 'z' and 'A' to 'Z' into 'regexp' variable
17-
'''
18-
regexp = re.compile('[^a-zA-Z]+')
15+
16+
# This re.compile() function saves the pattern from 'a' to 'z' and 'A' to 'Z' into 'regexp' variable
17+
regexp = re.compile("[^a-zA-Z]+")
1918

2019

2120
def swap_case(sentence):
@@ -24,7 +23,7 @@ def swap_case(sentence):
2423
>>> swap_case('Algorithm.Python@89')
2524
aLGORITHM.pYTHON@89
2625
"""
27-
new_string = ''
26+
new_string = ""
2827
for char in sentence:
2928
if char.isupper() == True:
3029
new_string += char.lower()
@@ -36,5 +35,5 @@ def swap_case(sentence):
3635
return new_string
3736

3837

39-
if __name__ == '__main__':
38+
if __name__ == "__main__":
4039
print(swap_case(input("Please input sentence:")))

0 commit comments

Comments
 (0)