WhitePages
WhitePages
CHALLENGE DESCRIPTION
SOLUTION
We try to see the file, but there is something inside but we can not see.
We search for space character ` ` in the file, and we see that it’s not only space, but something like tab and more.
So the idea is replace space with 1
and tab with 0
1
2
3
4
5
6
with open('whitepages.txt', 'r') as file:
content = file.read()
converted = ''.join(['1' if char == ' ' else '0' for char in content])
print(converted)