Chhavi Sharma Project File XII-A (Updated)
Chhavi Sharma Project File XII-A (Updated)
Gurugram
PROJECT
COMPUTER SCIENCE
Academic Year 2023-24
Roll Number :
\
BONAFIDE CERTIFICATE
PRINCIPAL
ACKNOWLEDGEMENT
SOURCE CODE
SAMPLE OUTPUT
INTRODUCTION
Python is an interpreted, high-level, general- purpose
programming language. Created by Guido van Rossum
and first released in 1991,Python’s design philosophy
emphasizes code readability with its notable use of
significant whitespace. Its language constructs and
object-oriented approach aim to help programmers write
clear, logical code forsmall and large scale objects.
RAM : 12 GB
Operating System : 64 bit x64
Hard Disk : 150 MB Free
Processor : Intel(R) Core 2.20 GHz
Screen Resolution : 1366 x 768
Graphics Card : Minimum 64 MB
Platform : Windows 10
Python Version : Python 3.0 or Greate
SOURCE CODE
def New():
N1=input("Enter citizen's Name: ")
A1=input("Enter complete Address of citizen: ")
G1=input("Enter Gender of citizen: ")
a1=int(input("Enter Age of Citizen: "))
DOR=input("Enter Date of Registration
as(yyyy/mm/dd): ")
POB=input("Enter Place of Birth: ")
POR=input("Enter Place of Registration: ")
ACN=int(input("Enter Aadhar Card Number: "))
VIP=int(input("Enter Voter ID Card Number: "))
l1=[N1,A1,G1,a1,DOR,POB,POR,ACN,VIP]
query='insert into data
values(%s,%s,%s,%s,%s,%s,%s,%s,%s)'
cur.execute(query,l1)
print('Record Updated.....')
con.commit()
con.close()
def Search():
ak=int(input('''Search for:
1)Passport already expired(Enter 1)
2)Information of a person (Enter 2)
'''))
if ak==1:
ques=input("Enter Today's Date as(yyyy/mm/dd): ")
d=int(ques[0:4])
c=d-10
sql='select* from data where year(DOR)<=%s'%(c,)
elif ak==2:
ques=input("Enter Aadhar card number to be searched")
sql='select * from data where ACN=%s'%(ques,)
cur.execute(sql)
print("Given below is the data you required:")
for i in cur:
print('Name:',i[0])
print('Address:',i[1])
print('Gender:',i[2])
print('Age:',i[3])
print('Date Of Registration:',i[4])
print('Place Of Birth:',i[5])
print('Place of Registration:',i[6])
print('Aadhar Card Number:',i[7])
print('Voter ID Proof:',i[8])
print()
print()
con.close()
def Display():
sql='select * from data'
cur.execute(sql)
for i in cur:
print('Name:',i[0])
print('Address:',i[1])
print('Gender:',i[2])
print('Age:',i[3])
print('Date Of Registration:',i[4])
print('Place Of Birth:',i[5])
print('Place of Registration:',i[6])
print('Aadhar Card Number:',i[7])
print('Voter ID Proof:',i[8])
print()
print()
con.close()
def Update():
akk=int(input('''
1)Renew Passport(Enter 1)
2)Personal Detail of a Person(Enter 2)
'''))
if akk==1:
New()
elif akk==2:
qu=int(input('Enter Aadhar Card Number: '))
e=int(input('''Do you wish to update your:
1)Name (Enter 1)
2)Address (Enter 2)
3)Both (Enter 3)
'''))
if e==1:
t=input('Enter Updated Name: ')
sql='update data set Name=%s where ACN=%s'
g=(t,qu)
cur.execute(sql,g)
elif e==2:
t=input('Enter Updated Address: ')
sql='update data set address=%s where acn=%s'
g=(t,qu)
cur.execute(sql,g)
else :
t=input('Enter Updated Name: ')
y=input('Enter Updated Address: ')
sql='update data set name=%s,address=%s where
acn=%s'
g=(t,y,qu)
cur.execute(sql,g)
con.commit()
def Delete():
ques=input("Enter Today's Date as(yyyy/mm/dd): ")
d=int(ques[0:4])
c=d-10
sql='Delete from data where year(DOR)<=%s'%(c,)
cur.execute(sql)
print("Record of expired passports is deleted
successfully!!")
con.commit()
while True:
import mysql.connector as ms
con=ms.connect(host='localhost',user='root',password='',)
cur=con.cursor()
cur.execute('Create database Bhavi_Passport')
cur.execute('Use Bhavi_Passport')
create='Create table data(Name Varchar(50),Address
varchar(50),Gender varchar(10),Age int,DOR date,\
POB varchar(20),POR varchar(100),ACN
decimal(12,0),VIPN int)'
cur.execute(create)
print("..........MAIN MENU............")
q=int(input('''
1)New Passport(Enter 1)
2)Display Passports(Enter 2)
3)Search Passport(Enter 3)
4)Update Passport(Enter 4)
5)Delete Passport(Enter 5)
6)Exit(Enter 6)
'''))
if q==1:
New()
elif q==2:
Display()
elif q==3:
Search()
elif q==4:
Update()
elif q==5:
Delete()
elif q==6:
break
else:
print("Wrong Input")
OUTPUT
# MAIN MENU
#Renew a Passport
#Update Personal Detail of a Person
# update name
#update Address
#update both
Eoi.gov.in
www.alternativeairlines.com