Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
suyashi29
GitHub Repository: suyashi29/python-su
Path: blob/master/Python core/Ticket booking Interface.ipynb
3074 views
Kernel: Python 3
a=["ASHI"] b=["SID"] c=["ABHI"] d=["abc123"] e=["123abc"] f=["sun123"] gender1=["M","F","m","f"] wel="Welcome to Ticket booking" inc="Incorrect password" male=["M","m"] female=["F","f"] k=1 s=2 aw=1 ah=0 while int(k)==1 and s==2 : g= input("Enter username : ") if g in a: h=str(input("Enter your password ASHI : ")) if h in d: print(wel) s=4 else: print(inc) s=1 elif g in b: h=str(input("Enter your password SID : ")) if h in e: print(wel) s=4 else: print(inc) s=1 elif g in c: h=str(input("Enter your password ABHI: ")) if h in f: print(wel) s=4 else: print(inc) s=1 else: k=input("You are not authorized user\nPress 1 to try again, else press any other key to end: ") if s==1: s=2 k=input("Press 1 to try again, else press any other key to end: ") if (str(k)).isdigit(): if int(k)!=1 : k=3 else: k=3 if s==4: while aw==1: gen=5 ag=3 name=input("Enter name : ") while gen==5: gender=input("Enter gender M or F : ") if gender in gender1: gen=4 else: print("Invalid gender input.") while ag==3: age=input("Enter age : ") if (str(age)).isdigit(): age=int(age) if age>0: ag=2 else: print("Invalid age input.") else: print("Invalid age input.") if age>0 and age<18: z=input("Child fare applicable (Rs. 750)\nPress 1 to pay and confirm booking else press any other key.\n") elif age>=18 and age<50: if gender in male: z=input("Male citizen fare applicable (Rs. 1000)\nPress 1 to pay and confirm booking else press any other key.\n") else: z=input("Female citizen fare applicable (Rs. 500)\nPress 1 to confirm booking else press any other key.\n") else: if gender in male: z=input("Senior male citizen fare applicable (Rs. 250)\nPress 1 to pay and confirm booking else press any other key.\n") else: z=input("Senior female citizen fare applicable (Rs. 0)\nPress 1 to confirm booking else press any other key.\n") if str(z).isdigit(): if int(z)==1: print("Booking Confirmed!") #url="https://api.thingspeak.com/update?api_key=2VI66I3W1ADefg&field1=1" #respose=requests.post(url) else: print("Booking not confirmed.") # url="https://api.thingspeak.com/update?api_key=2VI66I3W1ADAU49t&field1=0" #response=requests.post(url) else: print("Booking not confirmed.") #url="https://api.thingspeak.com/update?api_key=2VI66I3W1ADAU49J&field1=0" #response=requests.post(url) aw=input("To make another booking, press 1 else press any other key to end the program: ") if (str(aw)).isdigit(): if int(aw)!=1: aw=3 else: aw=1 else: aw=3 while ah<5: rt=input("End")
Enter username : ASHI Enter your password ASHI : abc123 Welcome to Ticket booking Enter name : suyashi Enter gender M or F : F Enter age : 29 Female citizen fare applicable (Rs. 500) Press 1 to confirm booking else press any other key. 1 Booking Confirmed! To make another booking, press 1 else press any other key to end the program: 2 End End End2 End3 Endp