alphabet def phone_checker phone if phone phone phone phone phone repl

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
def phone_checker(phone=''):
if phone[0:2] == '+7':
phone = '8' + phone[2:]
phone = phone.replace('(', '')
phone = phone.replace(')', '')
phone = phone.replace('-', '')
phone = phone.replace(' ', '')
if len(phone) != 11:
return 'Vvedite nomer zanovo'
for letter in phone:
if letter in alphabet:
return False
return True
phone1 = '8 916 143 61 2b'
phone2 = '+7 (963)6706376'
phone3 = '2345678900909'
phone4 = '+7 963 222-33-80'
print phone_checker(phone1)