File tree 1 file changed +0
-21
lines changed
1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change @@ -27,27 +27,6 @@ def swap_case(input_string: str) -> str:
27
27
swapped_list = "" .join (list_representation )
28
28
return swapped_list
29
29
30
-
31
- def swap_case (input_string ) -> None :
32
- # This method will swap the cases of a given string
33
- # eg: input: s= "Hello" output: t="hELLO"
34
- list_representation = list (input_string )
35
- for i in range (len (list_representation )):
36
- if list_representation [i ] >= "A" and list_representation [i ] <= "Z" :
37
- m2 = ord (list_representation [i ])
38
- m1 = m2 + 32
39
- list_representation [i ] = chr (m1 )
40
- elif list_representation [i ] >= "a" and list_representation [i ] <= "z" :
41
- m3 = ord (list_representation [i ])
42
- m4 = m3 - 32
43
- list_representation [i ] = chr (m4 )
44
- else :
45
- pass
46
- swapped_list = [ele for ele in list_representation ]
47
- swapped_list = "" .join (swapped_list )
48
- return swapped_list
49
-
50
-
51
30
if __name__ == "__main__" :
52
31
# sample test case
53
32
input_string = "Hello"
You can’t perform that action at this time.
0 commit comments