import time
private_owner=["A11111","B11111","C11111","D11111"]
temporary_car={}
gate_enter=input("輸入您的車牌號: ")
if gate_enter in private_owner:
print("歡迎, 月租用戶"+gate_owner+" !")
else:
temporary_car[gate_enter] = int(time.time())
print("歡迎, 訪客"+gate_enter+" !")
print(temporary_car)
gate_leave=input("輸入您的車牌號: ")
if gate_leave in private_owner:
print("歡迎, 月租用戶"+gate_owner+" !")
else:
leave_time=int(time.time())
if gate_leave in temporary_car:
parking_time= abs(temporary_car[gate_enter] - leave_time)
print(leave_time)
print(parking_time)
print("歡迎, 訪客"+gate_enter+" !")
print(temporary_car)
else:
print("Please contact parking-lot manager ASAP.")
|