Use the programming interface to complete this task.
Input: A string containing alphanumeric characters.
Output: A string containing only the letters of the input.
Read the input from a file called looking-for-letters.in
that's in the current working directory, and then write your output to a file called looking-for-letters.out
.
If you need help, try looking at the Python Tutorial in the Learn section!
file1 = open("looking-for-letters.in", 'r')
s = file1.read().strip()
characters = [c for c in str(s)]
final = list()
for x in characters:
if ord(x) >= 65 and ord(x) <= 90:
final.append(x)
elif ord(x) >= 97 and ord(x) <= 122:
final.append(x)
letters = "".join(final)
file2 = open("looking-for-letters.out", 'w')
file2.write(str(letters) + "\n")
file1.close()
file2.close()
easyctf{filtering_the_#s_out}