PYTHON PROGRAMMING
BESANT TECHNOLOGIES
PROJECT
ATM CONCEPT
COVID 19 MANAGEMENT SYSTEM
TRAVEL AGENCY CONCEPT
Batch No: 74
Full name: Balasastha. P
Mobile no: 9514281390
Alternate no: 9047417989
Email: balasastha1002@[Link]
College name: Nehru institute of engineering and technology
Location: Coimbatore
ATM CONCEPT:
PROGRAM:
DATABASE CREATION:
import [Link]
db = [Link](
host="localhost",
user="root",
password="2001",
)
mycursor= [Link]()
[Link]("CREATE DATABASE ATM")
print("success")
OUTPUT:
DATABASE TABLE CREATION:
import [Link]
mydb=[Link](
host="localhost",
user="root",
password="2001",
database="ATM"
)
#database creation
#connectionline
mycursor=[Link]()
#************************************************
[Link]("CREATE TABLE Accountdetails (Name varchar(255),Accountno
Bigint(15),Phoneno Bigint(20),Balance Bigint(20))")
print("Table created succesfully")
OUTPUT:
INSERTING VALUES INTO DATABASE:
import [Link]
mydb = [Link](
host="localhost",
user="root",
password="2001",
database="ATM"
)
mycursor = [Link]()
sql = "INSERT INTO Accountdetails (Name,Accountno,Phoneno,Balance) VALUES
(%s,%s,%s,%s)"
val = [
('Peter', '456743257890', '9514281390','1000'),
('Amy','345632148976', '9047417989','10000'),
('Hannah','453265437865', '9976486470','100000')
]
[Link](sql, val)
[Link]()
print([Link], "record was inserted.")
OUTPUT:
Details inserted successfully
MAIN PROGRAM:
#Personal details
print("Name: Balasatha P")
print("Email: balasastha1002@[Link]")
print("Phone no: 9514281390")
print("Batch: Python")
print("Batch no:74")
print("Welcome to BOI ATM")
print("\nPlease insert your card")
def views():
# connection lines
import [Link]
mydb=[Link](
host="localhost",
user="root",
password="2001",
database="ATM"
)
mycursor=[Link]()
#Get phone no
Phoneno=int(input("Enter Phone no: "))
[Link]("select Phoneno from Accountdetails where
Phoneno={}".format(Phoneno))
myresult = [Link]()
#Choose the language
for x in myresult:
print ("Entered Phone no is:",*x,sep='')
print("\nSelect Language [Link] [Link]")
Lan=int(input("Enter number: "))
if Lan==1:
#Generate OTP
import random
otp_no=[Link](1111,9999)
print ("Your OTP is: ",otp_no)
otp=int(input("Enter 4 digit OTP no: "))
#Check for OTP
if otp==otp_no:
print("MENU")
print("\[Link] \[Link] \[Link] \[Link]
Deposit")
Option=int(input("Enter option number: "))
#1. Quickcash
if Option==1:
print("Choose your amount")
print("\n1.1000 \n2.2000 \n3.3000 \n4.4000 \n5.5000")
#Enter the option for amount to withdraw
Choose=int(input("Enter option no: "))
if Choose==1:
#Fetch balance from database for entered Phoneno
[Link]("Select Balance from Accountdetails
where Phoneno={}".format(Phoneno))
myresult = [Link]()
for x in myresult:
#Converting tuple to string
res = int(''.join(map(str, x)))
z = (str(res))
#Converting String to integer
q = int(z)
#Checking for enough balance available in account
if q>1000:
print("Withdraw successful")
remainbal=q-1000
bal=remainbal
#Updating remaining balance after withdraw
into database
query = "update Accountdetails set
Balance='{}' where Phoneno='{}'".format(bal,Phoneno)
[Link](query)
[Link]()
print("Available balance is: ",bal)
else:
print("Not enough balance")
#2.2000
elif Choose==2:
#Fetch balance from database for entered Phoneno
[Link]("Select Balance from Accountdetails
where Phoneno={}".format(Phoneno))
myresult = [Link]()
for x in myresult:
#Converting tuple to string
res = int(''.join(map(str, x)))
z = (str(res))
#Converting String to integer
q = int(z)
#Checking for enough balance available in account
if q>2000:
print("Withdraw successful")
remainbal=q-2000
bal=remainbal
#Updating remaining balance after withdraw
into database
query = "update Accountdetails set
Balance='{}' where Phoneno='{}'".format(bal,Phoneno)
[Link](query)
[Link]()
print("Available balance is: ",bal)
else:
print("Not enough balance")
#3.3000
elif Choose==3:
#Fetch balance from database for entered Phoneno
[Link]("Select Balance from Accountdetails
where Phoneno={}".format(Phoneno))
myresult = [Link]()
for x in myresult:
#Converting tuple to string
res = int(''.join(map(str, x)))
z = (str(res))
#Converting String to integer
q = int(z)
#Checking for enough balance available in account
if q>3000:
print("Withdraw successful")
remainbal=q-3000
bal=remainbal
#Updating remaining balance after withdraw
into database
query = "update Accountdetails set
Balance='{}' where Phoneno='{}'".format(bal,Phoneno)
[Link](query)
[Link]()
print("Available balance is: ",bal)
else:
print("Not enough balance")
#4.4000
elif Choose==4:
#Fetch balance from database for entered Phoneno
[Link]("Select Balance from Accountdetails
where Phoneno={}".format(Phoneno))
myresult = [Link]()
#Converting tuple to string
for x in myresult:
res = int(''.join(map(str, x)))
z = (str(res))
#Converting String to integer
q = int(z)
#Checking for enough balance available in account
if q>4000:
print("Withdraw successful")
remainbal=q-4000
bal=remainbal
#Updating remaining balance after withdraw
into database
query = "update Accountdetails set
Balance='{}' where Phoneno='{}'".format(bal,Phoneno)
[Link](query)
[Link]()
print("Available balance is: ",bal)
else:
print("Not enough balance")
#5.5000
elif Choose==5:
#Fetch balance from database for entered Phoneno
[Link]("Select Balance from Accountdetails
where Phoneno={}".format(Phoneno))
myresult = [Link]()
for x in myresult:
res = int(''.join(map(str, x)))
#Converting tuple to string
z = (str(res))
#Converting String to integer
q = int(z)
#Checking for enough balance available in account
if q>5000:
print("Withdraw successful")
remainbal=q-5000
bal=remainbal
#Updating remaining balance after withdraw
into database
query = "update Accountdetails set
Balance='{}' where Phoneno='{}'".format(bal,Phoneno)
[Link](query)
[Link]()
print("Available balance is: ",bal)
else:
print("Not enough balance")
else:
print ("Type only 1 to 5 only")
#2. Withdraw
elif Option==2:
withdraw=int(input("Enter amount to withdraw: "))
[Link]("Select Balance from Accountdetails where
Phoneno={}".format(Phoneno))
myresult = [Link]()
for x in myresult:
res = int(''.join(map(str, x)))
#Converting tuple to string
z = (str(res))
#Converting String to integer
q = int(z)
#Checking for enough balance available in account
if q>=withdraw:
print("Withdraw successful")
remainbal=q-withdraw
bal=remainbal
#Updating remaining balance after withdraw into
database
query = "update Accountdetails set Balance='{}'
where Phoneno='{}'".format(bal,Phoneno)
[Link](query)
[Link]()
print("Available balance is: ",bal)
else:
print("Not enough balance")
#3. Balance Enquiry
elif Option==3:
#Fetch balance from database for entered Phoneno
[Link]("Select Balance from Accountdetails where
Phoneno={}".format(Phoneno))
myresult = [Link]()
for x in myresult:
res = int(''.join(map(str, x)))
#Converting tuple to string
z = (str(res))
#Converting String to integer
q = int(z)
print("Available balance is: ",q)
#4. Cash deposit
elif Option==4:
#Enter amount to be deposited
amt=int(input("How much do you want to deposit? "))
#Fetch balance from database for entered Phoneno
[Link]("Select Balance from Accountdetails where
Phoneno={}".format(Phoneno))
myresult = [Link]()
for x in myresult:
res = int(''.join(map(str, x)))
#Converting tuple to string
z = (str(res))
#Converting String to integer
q = int(z)
#Calculating total balance after depositing
totalbal=amt+q
bal=totalbal
#Updating total balance after depositing into database
query = "update Accountdetails set Balance='{}' where
Phoneno='{}'".format(bal,Phoneno)
[Link](query)
[Link]()
print("Amount deposited successfully")
print("Available balance is: ",bal)
else:
print("Type only 1 to 4")
else:
print("Incorrect OTP")
elif Lan==2:
print("Sorry!! Currently unavailable")
else:
print("Enter 1 or 2 only")
views()
OUTPUT:
[Link]
Database output:
2. Withdraw
Database output:
3. Balance enquiry
Database output:
4. Cash deposit
Database output:
COVID 19 DATABASE MANAGEMENT SYSTEM
Database creation:
import [Link]
db = [Link](
host="localhost",
user="root",
password="2001",
)
mycursor= [Link]()
[Link]("CREATE DATABASE Covid_19_management_system")
print("Database created successfully")
Output:
Table creation:
mport [Link]
mydb=[Link](
host="localhost",
user="root",
password="2001",
database="Covid_19_management_system"
)
#database creation
#connectionline
mycursor=[Link]()
#************************************************
[Link]("CREATE TABLE covid_19 (Name varchar(255),Age
int(3),Bloodgroup varchar(255),Phoneno Bigint(20),Address
varchar(255),District varchar(255),State varchar(255),Aadharno
Bigint(15),Vaccination varchar(255),Admit DATE,Discharge DATE,Status
varchar(255))")
print("Table created succesfully")
Output:
Add patient details into database:
class main:
def values():
import [Link]
mydb=[Link](
host="localhost",
user="root",
password="2001",
database="Covid_19_management_system"
)
#value insertion
#connection line
mycursor=[Link]()
#inserting values into database
sql="insert into covid_19
(Name,Age,Bloodgroup,Phoneno,Address,District,State,Aadharno,Vaccination,Admit
,Discharge,Status) values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
Name=input("Enter Name: ")
try:
Age=int(input("Enter Age: "))
except:
print("Type valid age")
Age=int(input("Enter Age: "))
Bloodgroup=input("Enter Bloodgroup: ")
try:
Phoneno=int(input("Enter Phone no: "))
except:
print("Enter valid Phoneno")
Phoneno=int(input("Enter Phone no: "))
Address=input("Enter Address: ")
District=input("Enter district: ")
State=input("Enter state: ")
try:
Aadharno=int(input("Enter aadhar no: "))
except:
print("Enter valid Aadharno")
Aadharno=int(input("Enter aadhar no: "))
Vaccinationdetails=input("Enter vaccination details (Yes[Y]/No[N]): ")
if Vaccinationdetails=="Y":
Vaccination=int(input("How many doses: "))
elif Vaccinationdetails=="N":
Vaccination="NA"
else:
print("Please enter only 'Y' or 'N'")
try:
Admit=input("Enter Date of Admit 'YYYY-MM-DD': ")
except:
print("Enter valid date 'YYYY-MM-DD'")
Admit=input("Enter Date of Admit 'YYYY-MM-DD': ")
try:
Discharge=input("Enter Date of Discharge: ")
except:
print("Enter valid date 'YYYY-MM-DD'")
Discharge=input("Enter Date of Discharge 'YYYY-MM-DD': ")
Statusofpatient=input("Enter patient status Alive[A]/Dead[D]: ")
if Statusofpatient=="A":
Status="ACTIVE"
elif Statusofpatient=="D":
Status="INACTIVE"
else:
print("Please enter only 'A' or 'D'")
val=(Name,Age,Bloodgroup,Phoneno,Address,District,State,Aadharno,Vaccinati
on,Admit,Discharge,Status)
[Link](sql,val)
[Link]()
print("Row added suucessfully...")
# Continuation of adding another patient
def extra():
extra=input("Do You want to add another Patient Yes[Y]/No[N]: ")
if extra=="Y":
[Link]()
[Link]()
elif extra=="N":
import os
import sys
import covid
else:
print("Please enter only 'Y' or 'N'")
object=main
[Link]()
[Link]()
Output:
Database output:
Updating details into database:
def update():
print("What to you want to update?")
print("\n [Link]\n [Link]\n [Link]\n [Link]\n [Link]\n
[Link]\n [Link]\n [Link]\n [Link]\n [Link]\n [Link]\n
[Link]\n")
option=int(input("Enter a option: "))
import [Link]
mydb=[Link](
host="localhost",
user="root",
password="2001",
database="Covid_19_management_system"
)
mycursor = [Link]()
if option==1:
try:
Phoneno=int(input("Enter patient Phoneno to update details: "))
except:
print("Enter valid Phoneno: ")
Phoneno=int(input("Enter patient Phoneno to update details: "))
Name=input("Enter Name: ")
query = "update covid_19 set Name='{}' where
Phoneno={}".format(Name,Phoneno)
[Link](query)
[Link]()
print("Updated successfully")
elif option==2:
try:
Phoneno=int(input("Enter patient Phoneno to update details: "))
except:
print("Enter valid Phoneno: ")
Phoneno=int(input("Enter patient Phoneno to update details: "))
try:
Age=int(input("Enter Age: "))
except:
print("Enter valid Phoneno")
Age=int(input("Enter Age: "))
query = "update covid_19 set Age={} where Phoneno={}".format(Age,Phoneno)
[Link](query)
[Link]()
print("Updated successfully")
elif option==3:
try:
Phoneno=int(input("Enter patient Phoneno to update details: "))
except:
print("Enter valid Phoneno: ")
Phoneno=int(input("Enter patient Phoneno to update details: "))
Bloodgroup=input("Enter Bloodgroup: ")
query = "update covid_19 set Bloodgroup='{}' where
Phoneno={}".format(Bloodgroup,Phoneno)
[Link](query)
[Link]()
print("Updated successfully")
elif option==4:
try:
Aadharno=int(input("Enter patient Aadharno to update details: "))
except:
print("Enter valid Aadharno")
Aadharno=int(input("Enter patient Aadharno to update details: "))
try:
Phoneno=int(input("Enter patient Phoneno to update details: "))
except:
print("Enter valid Phoneno: ")
Phoneno=int(input("Enter patient Phoneno to update details: "))
query = "update covid_19 set Phoneno='{}' where
Aadharno={}".format(Phoneno,Aadharno)
[Link](query)
[Link]()
print("Updated successfully")
elif option==5:
try:
Phoneno=int(input("Enter patient Phoneno to update details: "))
except:
print("Enter valid Phoneno: ")
Phoneno=int(input("Enter patient Phoneno to update details: "))
Address=input("Enter Address: ")
query = "update covid_19 set Address={} where
Phoneno={}".format(Address,Phoneno)
[Link](query)
[Link]()
print("Updated successfully")
elif option==6:
try:
Phoneno=int(input("Enter patient Phoneno to update details: "))
except:
print("Enter valid Phoneno: ")
Phoneno=int(input("Enter patient Phoneno to update details: "))
District=input("Enter District: ")
query = "update covid_19 set District='{}' where
Phoneno={}".format(District,Phoneno)
[Link](query)
[Link]()
print("Updated successfully")
elif option==7:
try:
Phoneno=int(input("Enter patient Phoneno to update details: "))
except:
print("Enter valid Phoneno: ")
Phoneno=int(input("Enter patient Phoneno to update details: "))
State=input("Enter State: ")
query = "update covid_19 set State='{}' where
Phoneno={}".format(State,Phoneno)
[Link](query)
[Link]()
print("Updated successfully")
elif option==8:
try:
Phoneno=int(input("Enter patient Phoneno to update details: "))
except:
print("Enter valid Phoneno: ")
Phoneno=int(input("Enter patient Phoneno to update details: "))
try:
Aadharno=int(input("Enter patient Aadharno to update details: "))
except:
print("Enter valid Aadharno")
Aadharno=int(input("Enter patient Aadharno to update details: "))
query = "update covid_19 set Aadharno={} where
Phoneno={}".format(Aadharno,Phoneno)
[Link](query)
[Link]()
print("Updated successfully")
elif option==9:
try:
Phoneno=int(input("Enter patient Phoneno to update details: "))
except:
print("Enter valid Phoneno: ")
Phoneno=int(input("Enter patient Phoneno to update details: "))
Vaccinationdetails=input("Enter vaccination details (Yes[Y]/No[N]): ")
if Vaccinationdetails=="Y":
Vaccination=int(input("How many doses: "))
elif Vaccinationdetails=="N":
Vaccination="NA"
else:
print("Please enter only 'Y' or 'N'")
query = "update covid_19 set Vaccination={} where
Phoneno={}".format(Vaccination,Phoneno)
[Link](query)
[Link]()
print("Updated successfully")
elif option==10:
try:
Phoneno=int(input("Enter patient Phoneno to update details: "))
except:
print("Enter valid Phoneno: ")
Phoneno=int(input("Enter patient Phoneno to update details: "))
try:
Admit=input("Enter Date of Admit 'YYYY-MM-DD': ")
except:
print("Enter valid date 'YYYY-MM-DD'")
Admit=input("Enter Date of Admit 'YYYY-MM-DD': ")
query = "update covid_19 set Admit='{}' where
Phoneno={}".format(Admit,Phoneno)
[Link](query)
[Link]()
print("Updated successfully")
elif option==11:
try:
Phoneno=int(input("Enter patient Phoneno to update details: "))
except:
print("Enter valid Phoneno: ")
Phoneno=int(input("Enter patient Phoneno to update details: "))
try:
Discharge=input("Enter Date of Discharge: ")
except:
print("Enter valid date 'YYYY-MM-DD'")
Discharge=input("Enter Date of Discharge 'YYYY-MM-DD': ")
query = "update covid_19 set Discharge='{}' where
Phoneno={}".format(Discharge,Phoneno)
[Link](query)
[Link]()
print("Updated successfully")
elif option==12:
try:
Phoneno=int(input("Enter patient Phoneno to update details: "))
except:
print("Enter valid Phoneno: ")
Phoneno=int(input("Enter patient Phoneno to update details: "))
Statusofpatient=input("Enter patient status Alive[A]/Dead[D]: ")
if Statusofpatient=="A":
Status="ACTIVE"
elif Statusofpatient=="D":
Status="INACTIVE"
else:
print("Please enter only 'A' or 'D'")
query = "update covid_19 set Status='{}' where
Phoneno={}".format(Status,Phoneno)
[Link](query)
[Link]()
print("Updated successfully")
else:
print("Print only 1 to 10")
Output:
Count:
def status():
import [Link]
mydb=[Link](
host="localhost",
user="root",
password="2001",
database="Covid_19_management_system"
)
mycursor = [Link]()
query = "SELECT count(*) AS New_column_name FROM covid_19 where Status =
'ACTIVE'"
[Link](query)
myresult = [Link]()
print("NO of ACTIVE Patients are: ",myresult[-1][-1])
query = "SELECT count(*) AS New_column_name FROM covid_19 where Status =
'INACTIVE'"
[Link](query)
myresult = [Link]()
print("NO of INACTIVE Patients are: ",myresult[-1][-1])
query = "SELECT count(*) AS New_column_name FROM covid_19"
[Link](query)
myresult = [Link]()
print("NO of total Patients are: ",myresult[-1][-1])
[Link]()
Output:
Delete Patient details:
def deleting():
import [Link]
mydb=[Link](
host="localhost",
user="root",
password="2001",
database="Covid_19_management_system"
)
mycursor=[Link]()
try:
Phoneno=int(input("Enter Phone no: "))
except:
print("Enter valid Phoneno")
Phoneno=int(input("Enter Phone no: "))
sql = "DELETE FROM covid_19 WHERE Phoneno = '{}'".format(Phoneno)
[Link](sql)
[Link]()
print([Link], "record(s) deleted")
Output:
Database output:
View patient details:
def views():
import [Link]
mydb=[Link](
host="localhost",
user="root",
password="2001",
database="Covid_19_management_system"
)
mycursor=[Link]()
try:
Phoneno=int(input("Enter Phone no: "))
except:
print("Enter valid Phoneno")
Phoneno=int(input("Enter Phone no: "))
[Link]("select * from covid_19 where
Phoneno='{}'".format(Phoneno))
myresult = [Link]()
for x in myresult:
print(x)
else:
print("No recors found")
Output:
Database Output:
Main File Program:
#Personal details
print("Name: Balasatha P")
print("Email: balasastha1002@[Link]")
print("Phone no: 9514281390")
print("Batch: Python")
print("Batch no:74")
import os
import sys
import countstatus
import updating
import view
import delete
def menu_details():
print("\n*****COVID-19 MANAGEMENT SYSTEM*****")
print("\nChoose the option from below menu")
print("\n [Link] patient details\n [Link] patient details\n [Link] status
of active and inactive patients\n [Link] a patient\n [Link] particular
patient details\n [Link]")
option=int(input("Enter a number: "))
if option==1:
import insert
[Link]
elif option==2:
[Link]()
elif option==3:
[Link]()
elif option==4:
[Link]()
elif option==5:
[Link]()
elif option==6:
print()
else:
print ("Enter only 1 to 6")
menu_details()
HOTEL MANAGEMENT
Database creation:
#SQL Connection
import [Link]
db = [Link](
host="localhost",
user="root",
password="2001",
)
mycursor= [Link]()
[Link]("CREATE DATABASE Hotel_management_system")
print("Database created successfully")
Output:
Table creation for restaurant:
import [Link]
mydb=[Link](
host="localhost",
user="root",
password="2001",
database="Hotel_management_system"
)
#database creation
#connectionline
mycursor=[Link]()
#************************************************
[Link]("CREATE TABLE Restaurant (Name varchar(255),Phoneno
Bigint(20),Aadharno bigint(20),Type varchar(255),Cart varchar(255),Days
Bigint(20), Amount Bigint(20))")
print("Table created succesfully")
Output:
Customer details:(Restaurant)
import [Link]
mydb=[Link](
host="localhost",
user="root",
password="2001",
database="Hotel_management_system"
)
#database creation
#connectionline
mycursor=[Link]()
sql="insert into Restaurant (Name,Phoneno,Aadharno,Type,Cart,Days,Amount)
values (%s,%s,%s,%s,%s,%s,%s)"
Name=input("Enter Name: ")
try:
Phoneno=int(input("Enter Phoneno: "))
except:
print ("Print valid no")
Phoneno=int(input("Enter Phoneno: "))
try:
Aadharno=int(input("Enter Aadhar no: "))
except:
print("Enter valid no")
Aadharno=int(input("Enter Aadhar no: "))
print ("\nWhat do you prefer? \[Link] with food \[Link]
without food")
try:
choice=int(input("Enter your choice: "))
except:
print("Enter valid no")
if choice==1:
print("\nChoose \[Link] cart \[Link]")
choose=int(input("\nChoose"))
if choose==1:
Cart="Single cart"
print("\nType of Room \[Link] \[Link]-AC")
try:
pick=int(input("Enter option: "))
except:
print("Enter valid no")
pick=int(input("Enter option: "))
if pick==1:
Type="A/C"
print("Total charge for accomdation is: Rs:2000/day")
try:
Days=int(input("Enter no of days: "))
except:
print("Enter valid no")
Days=int(input("Enter no of days: "))
totalamt=Days*2000
Amount=totalamt
print("Total charge is:",Amount)
try:
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
except:
print("Enter valid no")
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
if choose==1:
print("Thanks for choosing us!!!")
elif choose==2:
print()
else:
print("Type only 1 or 2")
elif pick==2:
Type="NON A/C"
print("Total charge for accomdation is: Rs:1000/day")
try:
Days=int(input("Enter no of days: "))
except:
print("Enter valid no")
Days=int(input("Enter no of days: "))
totalamt=Days*1000
Amount=totalamt
print("Total charge is: ",Amount)
try:
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
except:
print("Enter valid no")
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
if choose==1:
print("Thanks for choosing us!!!")
elif choose==2:
print()
else:
print("Type only 1 or 2")
elif choose==2:
Cart="Double cart"
print("\nType of Room \[Link] \[Link]-AC")
try:
pick=int(input("Enter option: "))
except:
print("Enter valid no")
pick=int(input("Enter option: "))
if pick==1:
Type="A/C"
print("Total charge for accomdation is: Rs:4000/day")
try:
Days=int(input("Enter no of days: "))
except:
print("Enter valid no")
Days=int(input("Enter no of days: "))
totalamt=Days*4000
Amount=totalamt
print("Total charge is: ",Amount)
try:
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
except:
print("Enter valid no")
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
if choose==1:
print("Thanks for choosing us!!!")
elif choose==2:
print()
else:
print("Type only 1 or 2")
elif pick==2:
Type="NON A/C"
print("Total charge for accomdation is: Rs:2000/day")
try:
Days=int(input("Enter no of days: "))
except:
print("Enter valid no")
Days=int(input("Enter no of days: "))
totalamt=Days*2000
Amount=totalamt
print("Total charge is: ",Amount)
try:
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
except:
print("Enter valid no")
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
if choose==1:
print("Thanks for choosing us!!!")
elif choose==2:
print()
else:
print("Type only 1 or 2")
else:
print ("Enter only 1 or 2")
elif choice==2:
print("\nChoose \[Link] cart \[Link]")
choose=int(input("\nChoose \[Link] cart \[Link]"))
if choose==1:
Cart="Single cart"
print("\nType of Room \[Link] \[Link]-AC")
try:
pick=int(input("Enter option: "))
except:
print("Enter valid no")
pick=int(input("Enter option: "))
if pick==1:
Type="A/C"
print("Total charge for accomdation is: Rs:1000/day")
try:
Days=int(input("Enter no of days: "))
except:
print("Enter valid no")
Days=int(input("Enter no of days: "))
totalamt=Days*1000
Amount=totalamt
print("Total charge is: ",Amount)
try:
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
except:
print("Enter valid no")
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
if choose==1:
print("Thanks for choosing us!!!")
elif choose==2:
print()
else:
print("Type only 1 or 2")
elif pick==2:
Type="NON A/C"
print("Total charge for accomdation is: Rs:500/day")
try:
Days=int(input("Enter no of days: "))
except:
print("Enter valid no")
Days=int(input("Enter no of days: "))
totalamt=Days*500
Amount=totalamt
print("Total charge is: ",Amount)
try:
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
except:
print("Enter valid no")
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
if choose==1:
print("Thanks for choosing us!!!")
elif choose==2:
print()
else:
print("Type only 1 or 2")
elif choose==2:
Cart="Double cart"
print("\nType of Room \[Link] \[Link]-AC")
try:
pick=int(input("Enter option: "))
except:
print("Enter valid no")
pick=int(input("Enter option: "))
if pick==1:
Type="A/C"
print("Total charge for accomdation is: Rs:2000/day")
try:
Days=int(input("Enter no of days: "))
except:
print("Enter valid no")
Days=int(input("Enter no of days: "))
totalamt=Days*2000
Amount=totalamt
print("Total charge is: ",Amount)
try:
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
except:
print("Enter valid no")
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
if choose==1:
print("Thanks for choosing us!!!")
elif choose==2:
print()
else:
print("Type only 1 or 2")
elif pick==2:
Type="NON A/C"
print("Total charge for accomdation is: Rs:1000/day")
try:
Days=int(input("Enter no of days: "))
except:
print("Enter valid no")
Days=int(input("Enter no of days: "))
totalamt=Days*1000
Amount=totalamt
print("Total charge is: ",Amount)
try:
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
except:
print("Enter valid no")
choose=int(input("Are you sure want to confrim?
(Yes[1]/No[2]) "))
if choose==1:
print("Thanks for choosing us!!!")
elif choose==2:
print()
else:
print("Type only 1 or 2")
else:
print ("Enter only 1 or 2")
else:
print("Enter only 1 0r 2")
val=(Name,Phoneno,Aadharno,Type,Cart,Days,Amount)
[Link](sql,val)
[Link]()
print("Row added suucessfully...")
Output:
Database output:
Table creation for hotel:
import [Link]
mydb=[Link](
host="localhost",
user="root",
password="2001",
database="Hotel_management_system"
)
#database creation
#connectionline
mycursor=[Link]()
#************************************************
[Link]("CREATE TABLE Hotel (Phoneno Bigint(20), Preference
varchar(255), Amount Bigint(20))")
print("Table created succesfully")
Output:
Customer details:(Hotel)
import [Link]
mydb=[Link](
host="localhost",
user="root",
password="2001",
database="Hotel_management_system"
)
#database creation
#connectionline
mycursor=[Link]()
sql="insert into Hotel (Phoneno,Preference,Amount) values (%s,%s,%s)"
Phoneno=int(input("Enter Phone no: "))
print ("Preference")
print ("\[Link] \[Link] \[Link]")
try:
choose=int(input("Enter option: "))
except:
print("Enter valid no")
choose=int(input("Enter option: "))
if choose==1:
Preference="Breakfast"
print("MENU")
print("\[Link] \[Link] \[Link] \[Link] \[Link]")
try:
option=int(input("Enter option: "))
except:
print("Enter valid no")
option=int(input("Enter option: "))
if option==1:
print("Price of one idly is: Rs.5")
qty=int(input("Enter quantity: "))
totalamt=qty*5
Amount=totalamt
print("Total bill amount is: ",Amount)
elif option==2:
print("Price of one roast is: Rs.15")
qty=int(input("Enter quantity: "))
totalamt=qty*15
Amount=totalamt
print("Total bill amount is: ",Amount)
elif option==3:
print("Price of one Chappathi is: Rs.15")
qty=int(input("Enter quantity: "))
totalamt=qty*15
Amount=totalamt
print("Total bill amount is: ",Amount)
elif option==3:
print("Price of one Parotta is: Rs.20")
qty=int(input("Enter quantity: "))
totalamt=qty*20
Amount=totalamt
print("Total bill amount is: ",Amount)
elif option==4:
print("Price of one Parotta is: Rs.15")
qty=int(input("Enter quantity: "))
totalamt=qty*15
Amount=totalamt
print("Total bill amount is: ",Amount)
else:
print("Enter only 1 to 4")
elif choose==2:
Preference="Lunch"
print("MENU")
print("\[Link] Briyani \[Link] \[Link] Briyani")
try:
option=int(input("Enter option: "))
except:
print("Enter valid no")
option=int(input("Enter option: "))
if option==1:
print("Price of Veg Briyani is: Rs.100")
qty=int(input("Enter quantity: "))
totalamt=qty*100
Amount=totalamt
print("Total bill amount is: ",Amount)
elif option==2:
print("Price of Meals is: Rs.80")
qty=int(input("Enter quantity: "))
totalamt=qty*80
Amount=totalamt
print("Total bill amount is: ",Amount)
elif option==3:
print("Price of Mushroom Briyani is: Rs.150")
qty=int(input("Enter quantity: "))
totalamt=qty*150
Amount=totalamt
print("Total bill amount is: ",Amount)
else:
print ("Enter only 1 to 3")
elif choose==3:
Preference="Breakfast"
print("MENU")
print("\[Link] \[Link] \[Link] \[Link]")
try:
option=int(input("Enter option: "))
except:
print("Enter valid no")
option=int(input("Enter option: "))
if option==1:
print("Price of one idly is: Rs.5")
qty=int(input("Enter quantity: "))
totalamt=qty*5
Amount=totalamt
print("Total bill amount is: ",Amount)
elif option==2:
print("Price of one roast is: Rs.15")
qty=int(input("Enter quantity: "))
totalamt=qty*15
Amount=totalamt
print("Total bill amount is: ",Amount)
elif option==3:
print("Price of one Chappathi is: Rs.15")
qty=int(input("Enter quantity: "))
totalamt=qty*15
Amount=totalamt
print("Total bill amount is: ",Amount)
elif option==3:
print("Price of one Parotta is: Rs.20")
qty=int(input("Enter quantity: "))
totalamt=qty*20
Amount=totalamt
print("Total bill amount is: ",Amount)
else:
print("Enter only 1 to 3")
else:
print ("Enter only 1 to 4")
val=(Phoneno,Preference,Amount)
[Link](sql,val)
[Link]()
print("Row added suucessfully...")
Output:
Database output:
Main program file:
#Personal details
print("Name: Balasatha P")
print("Email: balasastha1002@[Link]")
print("Phone no: 9514281390")
print("Batch: Python")
print("Batch no:74")
print("Welcome to CUBA hotel and reataurant")
print("\nWhat do you prefer? \[Link] \[Link]")
try:
choice=int(input("Enter choice: "))
except:
print("Enter valid no")
choice=int(input("Enter choice: "))
if choice==1:
import Hotel
elif choice==2:
import restaurant
else:
print("Enter only 1 or 2")