Skip to content

Instantly share code, notes, and snippets.

@ldong
Created April 1, 2014 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ldong/9921759 to your computer and use it in GitHub Desktop.
Save ldong/9921759 to your computer and use it in GitHub Desktop.
Python Challenge Level 2
#!/usr/bin/env python2
### Original Repo http://hacked2bits.com/software/python-challenge/
file_name = raw_input("File name: ")
with open(file_name, 'r') as f:
file_data = f.read()
characters = []
data = list(file_data)
for i in xrange(len(data)):
if (65 <= ord(data[i]) <= 90) or (97 <= ord(data[i]) <= 122):
characters.append(data[i])
text = "".join(characters)
print text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment