Skip to content

Commit f6728de

Browse files
committed
Create swapcase.py
1 parent e14a4eb commit f6728de

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

swapcase.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
(c) Sergio Morales 2013
3+
CodeEval Challenge: Swap Case
4+
Date Solved: 12/09/13
5+
"""
6+
7+
import sys
8+
test_cases = open(sys.argv[1], 'r')
9+
for test in test_cases:
10+
for i in range(0, len(test)):
11+
if (test[i] >= 'A' and test[i] <= 'Z'):
12+
print( test[i].lower(), end="")
13+
else:
14+
print( test[i].upper(), end="")
15+
print('\n', end="")
16+
test_cases.close()

0 commit comments

Comments
 (0)