-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassign38traveler.py
40 lines (39 loc) · 1.19 KB
/
assign38traveler.py
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
35
36
37
38
39
40
def check_baggage(baggage_weight):
try:
if(baggage_weight>=0 and baggage_weight<=40):
return True
else:
return False
except:
print("Error occured in checking the baggage weight")
return None
def check_immigration(expiry_year):
try:
if(expiry_year>=2001 and expiry_year<=2025):
return True
else:
return False
except:
print("Error occured in checking the expiry year")
return None
def check_security(noc_status):
try:
if(noc_status=="valid" or noc_status=="VALID"):
return True
else:
return False
except:
print("Error occured in checking the status")
return None
def traveler():
traveler_id=1001
traveler_name="Jim"
check_baggage("a")
check_immigration(2019)
check_security("not valid")
if(check_baggage("a")==True and check_immigration(2019)==True and check_security("VALID")==True):
print(traveler_id, traveler_name, "\nAllow traveler to fly")
else:
print(traveler_id, traveler_name, "\nDetain traveler for re-checking")
return
traveler()