Created
April 24, 2013 21:14
-
-
Save maltzsama/5455631 to your computer and use it in GitHub Desktop.
Lowercase
Challenge Description: Given a string write a program to convert it into lowercase.
Input sample: The first argument will be a text file containing sentences, one per line. You can assume all characters are from the english language. e.g. HELLO CODEEVAL
This is some text Output sample: Print to stdout, the lowercase version of the sent…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys | |
| if (len(sys.argv) >= 2): | |
| fi = open(sys.argv[1], 'r') | |
| for i, n in enumerate(fi.readlines()): | |
| print n.rstrip().lower() | |
| fi.close() | |
| else: | |
| print "Cant find a entry" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment