Skip to content

Instantly share code, notes, and snippets.

@theBrokeQuant
Created October 31, 2013 17:56
Show Gist options
  • Save theBrokeQuant/7254074 to your computer and use it in GitHub Desktop.
Save theBrokeQuant/7254074 to your computer and use it in GitHub Desktop.
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