CODE
#CHECK MOBILE NUMBER.PY BY GEORGE SKOUROUPATHIS
import re
pattern = '''
^ #start of file
9 #first 9
(9|7|6) #9 or 7 or 6
\\d{6} #6 digits
$ #eof
'''
number = ""
while number != "exit":
number = raw_input("Type a mobile number. (type 'exit' to quit the program): ")
if number == "exit":
print "Goodbye user..."
print ""
print "Coding by George Skouroupathis"
testword = raw_input("(Press Enter to Quit)")
else:
if re.search(pattern, number, re.VERBOSE) != None:
print "O - Valid mobile number"
else:
print "X - Invalid mobile number"