I am trying to match a string of text in a list with the in
operator. All I get is a false response, even though the string is in the list.
[File ASpaceOdyssey.txt]
Behind every man now alive stand thirty ghosts, for that is the ratio by which the dead outnumber the living. Since the dawn of time, roughly a hundred billion human beings have walked the planet Earth.
Now this is an interesting number, for by a curious coincidence there are approximately a hundred billion stars in our local universe, the Milky Way. So for every man who has ever lived, in this Universe there shines a star.
'This day is not yet available'
But every one of those stars is a sun, often far more brilliant and glorious than the small, nearby star we call the Sun. And many - perhaps most - of those alien suns have planets circling them. So almost certainly there is enough land in the sky to give every member of the human species, back to the first ape-man, his own private, world-sized heaven - or hell.
My code:
Testdata = open('C:/ASpaceOdyssey.txt').readlines()
'This day is not yet available' in Testdata
False
"'This day is not yet available'" in Testdata
False
"This day is not yet available" in Testdata
False