You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
byr (Birth Year) - four digits; at least 1920 and at most 2002.
17
-
iyr (Issue Year) - four digits; at least 2010 and at most 2020.
18
-
eyr (Expiration Year) - four digits; at least 2020 and at most 2030.
19
-
hgt (Height) - a number followed by either cm or in:
20
-
If cm, the number must be at least 150 and at most 193.
21
-
If in, the number must be at least 59 and at most 76.
22
-
hcl (Hair Color) - a # followed by exactly six characters 0-9 or a-f.
23
-
ecl (Eye Color) - exactly one of: amb blu brn gry grn hzl oth.
24
-
pid (Passport ID) - a nine-digit number, including leading zeroes.
25
-
cid (Country ID) - ignored, missing or not.
16
+
"""check the following fields:
26
17
27
-
"""
28
-
checks.append(1920<=int(passport['byr']) <=2002)
29
-
checks.append(2010<=int(passport['iyr']) <=2020)
30
-
checks.append(2020<=int(passport['eyr']) <=2030)
31
-
checks.append(passport['hgt'][-2:] in ['cm', 'in'] and (passport['hgt'][-2:] in"in"andint(passport['hgt'][:-2]) >=59andint(passport['hgt'][:-2])<=76) or (passport['hgt'][-2:] in"cm"andint(passport['hgt'][:-2]) >=150andint(passport['hgt'][:-2])<=193))
0 commit comments