Created
October 31, 2013 17:56
-
-
Save theBrokeQuant/7254074 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phoneNumber = 8675309#int | |
def findPhoneNumber(phoneNumber): | |
e = "" | |
f = open("euler.txt") | |
line = f.readline() | |
while line: | |
e = e + line | |
line = f.readline() | |
f.close() | |
i = len(str(phoneNumber)) | |
while i <= len(e): | |
if e[i-len(str(phoneNumber)):i] == str(phoneNumber): | |
return "Phone number found at " + str(1+i-len(str(phoneNumber))) | |
i = i + 1 | |
return "Phone number not found" | |
print findPhoneNumber(phoneNumber) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment