Professional Documents
Culture Documents
conn=sql.connect(host='localhost',user='root',passwd='dream')
if conn.is_connected()==False:
c1=conn.cursor()
c1.execute("use exam")
c1.execute(v_sql)
co=c1.fetchall()
if co==[]:
c1.execute(v_sq)
dat=c1.fetchall()
user=input("user name: ")
passwd=input("password: ")
if (user,passwd) in dat:
q=1
while q==1 :
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("4: QUIT")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
if ch=='1':
if pawd=='inspiration':
print("\n\tWELCOME")
v_data=c1.fetchall()
v_count=len(v_data)
v_reg_no=(v_count+1)
print("\nENTER THESE DETAILS(take care to enter it with the first letter in capital and initial
at first):-\n ")
tot=m_p+m_c+m_b+m_co+m_e
avg=round((tot/5),2)
percen=round(((tot/500)*100),2)
if avg>=32:
res='PASS'
else:
res='FAIL'
c1.execute(hi)
conn.commit()
else:
elif ch=='2':
reg=int(input("Enter the registeration number: "))
c1.execute(v_ch)
data=c1.fetchone()
def gr(m):
if m>=90:
g='A1'
elif 90>m>=80:
g='A2'
elif 80>m>=70:
g='B1'
elif 70>m>=60:
g='B2'
elif 60>m>=50:
g="C1"
else:
g='C2'
return g
print("\
n**************************************************REPORT***************************
**************************************\n")
print("________________________________________________________________________________
____________________")
print("________________________________________________________________________________
____________________")
print("\nRESULT: ",data[17])
elif ch=='3':
print("\n********************************************~ MARK
LIST~******************************************************************\n")
ml="select*from info"
c1.execute(ml)
data=c1.fetchall()
print("________________________________________________________________________________
_______________________")
print("RNO.\tNAME\tGENDER\tCATEGORY\tCITY\tSTATE\tD.O.B\tNATIONALITY\tTOTAL\
tPERCENTAGE")
for j in range(len(data)):
print(data[j][0],"\t",data[j][1],"\t",data[j][4],"\t",data[j][5],"\t",data[j][6],"\t",data[j][7],"\
t",data[j][8],"\t",data[j][9],"\t",data[j][15],"\t",data[j][18])
elif ch=='4':
print("QUITTING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
break
else:
else: