alphabet character def passport_number_chec ker passport_number if pas

 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
27
28
29
30
31
32
33
34
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']
character = [' ', '!', '?' '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '+', '=', '~', '[', ']', '{', '}', ';', ':', '<', '>', '/']
def passport_number_checker(passport_number= ''):
if passport_number[0:1] == '+':
passport_number = passport_number [1:]
passport_number = passport_number.replace(' ', '')
passport_number = passport_number.replace('-', '')
if len(passport_number) !=10:
return False
for letter in passport_number:
if letter in alphabet:
return False
for letter in passport_number:
if letter in character:
return False
return True
passport_number1 = '67 68 789769'
passport_number2 = '5555 987789'
passport_number3 = '7899789987'
passport_number4 = '6611000000000'
passport_number5 = '+ 66 66 777777'
passport_number6 = '+ 6666-777777'
passport_number7 = '+9999 000ooo'
print passport_number_checker(passport_number1)