Page 51 - PYTHON-12
P. 51

adv_pay=float(input("Enter the Advance Amount: "))

                   room_type=int(input("Enter the Room Category:(1:Deluxe  2: Semi-Deluxe
               3:Standard)"))

                   if room_type==1:
                       room_type="Deluxe"

                   elif room_type==2:
                       room_type="Semi-Deluxe"

                   elif room_type==3:
                       room_type="Standard"

                   else:
                        print("Enter the correct Choice")

                   mycur=mydb.cursor()
                   str="Update hotel set
               cname='{}',address='{}',roomno='{}',mobileno={},check_in='{}',check_out='{}',
               adv_pay={},room_type='{}' where cno={}"


               query=str.format(cname,address,roomno,mobileno,check_in,check_out,adv_pay,
               room_type,cno)

                   mycur.execute(query)
                   mydb.commit()

                   mycur.execute("Select * from  hotel")
                   print("==========================================")

                   print("After Updation")
                   myrec=mycur.fetchall()

                   for x in myrec:
                       cno=x[0]

                       cname=x[1]
                       address=x[2]

                       roomno=x[3]
                       mobileno=x[4]

                       check_in=x[5]
                       check_out=x[6]

                       adv_pay=x[7]

                       room_type=x[8]
                       print(cno,cname,address,roomno,mobileno,check_in,check_out,adv_pay,
               room_type)
               def delete():
   46   47   48   49   50   51   52   53   54   55   56