Skip to content

Instantly share code, notes, and snippets.

@maltzsama
Created April 24, 2013 21:14
Show Gist options
  • Select an option

  • Save maltzsama/5455631 to your computer and use it in GitHub Desktop.

Select an option

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…
#!/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