Compute R: Science Project
Compute R: Science Project
R
SCIENCE
PROJECT
CODING
from tabulate import tabulate
c = []
def bill():
A = input
print("\t\t\t\t VEHICLE BILL FOR SALE")
print()
print()
print("\t\t 1. VEHICLE INFORMATION")
vehicle = [["MAKE",""],
["MODEL",""],
["STYLE / BODY TYPE",""],
["YEAR",""],
["COLOUR",""],
["ODOMETER READING",""],]
print(tabulate(vehicle,tablefmt = "fancy_grid"))
print("\t\t 2.THE PARTIES")
print("DATE OF SALE (mm/dd/yyyy) : ",A)
print()
print()
print("BUYER")
print("-----")
print("\t NAME :",name)
print("\t ADDRESS :",address)
print("PHONE :",ph," ","EMAIL :", mail)
print()
print("SELLER")
print("------")
print("\t SELLER NAME :","SAI CHARAN")
print("\t ADDRESS :"," CHENNAI")
print("PHONE :","8122768838""
","EMAIL :","[email protected]")
print()
print("E.SIGN BY THE BUYER AND SELLER")
# TATA CARS
i=1
j=0
def TATA():
tata_cars = [["CAR.NO","CAR NAME","PRICE","CAR TYPE"],
[1,"TIAGO","₹8.91 Lakhs Onwards","seden"],
[2,"ALTROZ","₹7.53 Lakhs Onwards","hatchbatch"],
[3,"TIGOR","₹6.00 Lakhs Onwards"," seden"],
[4,"NEXON","₹5.67 Lakhs Onwards","suv"],
[5,"HARRIER","₹8.20 Lakhs Onwards","suv"],
[6,"SAFARI","₹7.56 Lakhs Onwards","suv"],
[7,"NEXON EV","₹8.45 Lakhs Onwards","suv"]]
print()
print(tabulate(tata_cars , headers = "firstrow" , tablefmt = "fancy_grid"))
# FORD CARS
def FORD():
FORD_CARS = [["CAR.NO","CAR NAME","CAR TYPE"],
[1,"Ford Aspire","₹5.99 Lakhs Onwards","seden"],
[2,"Ford EcoSport","₹7.99 Lakhs Onwards","suv"],
[3,"Ford Endeavour","₹32.75 Lakhs Onwards","suv"],
[4,"Ford Figo","₹8.2 Lakhs Onwards","seden"],
[5,"Ford Freestyle","₹5.89 Lakhs Onwards","suv"],
[6,"Ford Mustang","₹74.62 Lakhs Onwards","muscle car"],
[7,"Ford Fusion","Rs.6.83 Lakh","hatchback"],
[8,"Ford Ikon","Rs.5.76 Lakh","seden"],
[9,"Ford Mondeo","Rs.15 Lakh","seden"],
[10,"Ford Mustang" ,"Rs.74.62 Lakh","muscle car"]]
print(tabulate(FORD_CARS, headers = "firstrow",tablefmt = "fancy_grid"))
print()
# HONDA CARS
def HONDA():
HONDA_CARS = [["CAR.NO","CAR NAME","CAR TYPE"],
[1,"Amaze","seden"],
[2,"Honda City","seden"],
[3,"Honda City Hybrid eHEV","seden"],
[4,"Honda Jazz","suv"],
[5,"Honda Accord","suv"],
[6,"Honda New City","seden"],
[7,"Brio","seden"],
[8,"Elevate","suv"],
[9,"Honda Vezel","suv"]]
def HYUNDAI():
HYUNDAI_CARS = [["CAR.NO","CAR NAME","CAR TYPE"],
[1,"Hyundai Creta","suv"],
[2, "Hyundai Venue","suv"],
[3 , "Hyundai Exter","suv"] ,
[4, "Hyundai Elite i20","suv"],
[5, "Hyundai New Santro","suv"],
[6,"Hyundai Exter","suv"],
[7, "Hyundai Verna","suv"],
[8, "Hyundai Aura","suv"],
[9,"Hyundai Ioniq 5","suv" ],
[10,"Hyundai New Santro","suv"],
[11,"Hyundai Ioniq 6" ,"suv"],
[12, "Hyundai New Creta","suv"],
[13, "Hyundai Palisade","suv"],
[14, "Hyundai New Sonata","suv"],
[15, "Hyundai New Kona Electric","suv"]]
print(tabulate(HYUNDAI_CARS,headers = "firstrow",tablefmt = "fancy_grid"))
print()
print(""" \t 1 - TO ACCESS CUSTOMER
\t 2 - TO ACCESS OWNER""")
consumer = int(input(" -> "))
if consumer == 1:
while True:
print("\t\t CUSTOMER")
name = input("NAME : ")
l = []
l = name
a=0
while True:
if name == "" and " ":
print("NAME CAN'T BE EMPTY")
name = input("NAME : ")
print()
elif len(name) <= 2:
print("ENTER YOUR NAME CORRECTLY")
name = input("NAME : ")
print()
elif name.isnumeric():
print("NAME DOES NOT CONTAIN NUMBERS")
name = input("NAME : ")
print()
elif name.isalpha:
l = l.upper()
for i in l:
if i == "A":
a = a+1
elif i == "E":
a = a +1
elif i == "I":
a = a+1
elif i == "O":
a =a +1
elif i == "U":
a =a+1
if a == 0 :
print("ATLEAST NAME SHOULD CONTAIN ONE VOWEL")
name = input("NAME : ")
else:
break
else:
break
print()
ph = int(input("PHONE NO \t\t : "))
p = []
p = str(ph)
while True:
if ph == "" and " ":
print("PHONE NUMBER CANNOT BE EMPTY")
ph = int(input("PHONE NO \t\t : "))
if details == 1:
print("\t\t TATA CARS")
TATA()
print("1 - IF YOU WANT TO SEE FURTHER DETAILS ABOUT TATA CAR")
print("2 - CAR BRANDS")
if True:
print()
choice = int(input("--> "))
if choice == 1:
a=1
while a == 1:
print()
TATA()
tata_cars = [["CAR.NO","CAR NAME","PRICE","CAR TYPE"],
[1,"TIAGO","₹8.91 Lakhs Onwards","seden"],
[2,"ALTROZ","₹7.53 Lakhs Onwards","hatchbatch"],
[3,"TIGOR","₹6.00 Lakhs Onwards"," seden"],
[4,"NEXON","₹5.67 Lakhs Onwards","suv"],
[5,"HARRIER","₹8.20 Lakhs Onwards","suv"],
[6,"SAFARI","₹7.56 Lakhs Onwards","suv"],
[7,"NEXON EV","₹8.45 Lakhs Onwards","suv"]]
car = int(input("CHOOSE A CAR NO FROM ABOVE -> "))
if car == 1 :
tiago = [["car name","TIAGO"],
["CAR TYPE","seden"],
["price","₹8.91 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(tiago,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
print("4 -> BILL")
ram = int(input( "\t --> "))
elif car == 2 :
altroz = [["car name","ALTROZ"],
["CAR TYPE","seden"],
["price","₹7.53 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(altroz,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
print("4 -> BILL")
ram = int(input( "\t --> "))
elif car == 3 :
tigor = [["car name","TIGOR"],
["CAR TYPE","seden"],
["price","₹6.00 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(tigor,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
print("4 -> BILL")
ram = int(input( "\t --> "))
elif car == 4 :
nexon = [["car name","NEXON"],
["CAR TYPE","seden"],
["price","₹8.91 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(nexon,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
print("4 -> BILL")
ram = int(input( "\t --> "))
elif car == 5 :
harrier = [["car name","HARRIER"],
["CAR TYPE","seden"],
["price","₹8.91 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(harrier,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
print("4 -> BILL")
ram = int(input( "\t --> "))
elif car == 6 :
safari = [["car name","SAFARI"],
["CAR TYPE","seden"],
["price","₹9.54 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(safari,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
print("4 -> BILL")
ram = int(input( "\t --> "))
elif car == 7 :
nexonev = [["car name","NEXON EV"],
["CAR TYPE","seden"],
["price","₹9.00 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(nexonev,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
print("4 -> BILL")
ram = int(input( "\t --> "))
else:
print("INVALID")
continue
if True:
if ram == 1:
continue
elif ram == 2:
break
elif ram == 3:
TATA()
print("ENTER THE CAR NUMBER TO COMPARE")
compare_cars = [["",],
["",],
["CAR TYPE",],
["ENGINE CC",],
["PRICE",],
]
while True:
compare = int(input("CAR NUMBER = "))
if compare >= 8:
print("THERE ARE ONLY SEVEN CARS")
continue
for i in tata_cars:
y=0
if i[0] != "CAR.NO":
if i[0] == compare:
c.insert(0,i)
for j in c:
r = str (j[1])
u = str(j[3])
f = str(j[2])
for o in compare_cars:
if y == 0:
o.insert(1,"CAR NAME")
if y == 1:
o.insert(1,r)
if y == 2:
o.insert(1,u)
if y == 3:
o.insert(1,"1999CC")
if y == 4:
o.insert(1,f)
y=y+1
print("IF YOU WANT TO ADD ANOTHER CAR ")
print("1 -> YES")
print("2 -> NO")
q = int(input(" --> "))
if q == 1:
D = "2000CC"
continue
elif q == 2:
print(tabulate(compare_cars,headers = "firstrow", tablefmt =
"psql"))
a=2
break
elif choice == 2:
details = 0
continue
elif details == 2:
print("\t\t FORD CARS")
FORD()
print("1 - IF YOU WANT TO SEE FURTHER DETAILS ABOUT FORD CAR")
print("2 - CAR BRANDS")
if True:
print()
choice = int(input("--> "))
if choice == 1:
while True:
print()
FORD()
FORD_CARS = [["CAR.NO","CAR NAME","CAR TYPE"],
[1,"Ford Aspire","₹5.99 Lakhs Onwards","seden"],
[2,"Ford EcoSport","₹7.99 Lakhs Onwards","suv"],
[3,"Ford Endeavour","₹32.75 Lakhs Onwards","suv"],
[4,"Ford Figo","₹8.2 Lakhs Onwards","seden"],
[5,"Ford Freestyle","₹5.89 Lakhs Onwards","suv"],
[6,"Ford Mustang","₹74.62 Lakhs Onwards","muscle car"],
[7,"Ford Fusion","Rs.6.83 Lakh","hatchback"],
[8,"Ford Ikon","Rs.5.76 Lakh","seden"],
[9,"Ford Mondeo","Rs.15 Lakh","seden"],
[10,"Ford Mustang" ,"Rs.74.62 Lakh","muscle car"]]
car = int(input("CHOOSE A CAR NO FROM ABOVE -> "))
if car == 1 :
tiago1 = [["car name","Ford Aspire"],
["CAR TYPE","seden"],
["price","₹8.91 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(tiago1,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
print("4 -> BILL")
ram = int(input( "\t --> "))
elif car == 2 :
altroz1 = [["car name","Ford EcoSport"],
["CAR TYPE","seden"],
["price","₹7.53 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(altroz1,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
print("4 -> BILL")
ram = int(input( "\t --> "))
elif car == 3 :
tigor1 = [["car name","Ford Endeavour"],
["CAR TYPE","seden"],
["price","₹6.00 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(tigor1,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 4 :
nexon1 = [["car name","Ford Figo"],
["CAR TYPE","seden"],
["price","₹8.91 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(nexon1,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 5 :
harrier1 = [["car name","Ford Freestyle"],
["CAR TYPE","seden"],
["price","₹8.91 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(harrier1,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 6 :
safari1 = [["car name","Ford Mustang"],
["CAR TYPE","seden"],
["price","₹9.54 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(safari1,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 7 :
nexonev1= [["car name","Ford Fusion"],
["CAR TYPE","seden"],
["price","₹9.00 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(nexonev1,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 8 :
Ford_Ikon =[["car name","Ford Ikon"],
["CAR TYPE","seden"],
["price","₹9.00 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(Ford_Ikon ,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 9 :
FordMondeo =[["car name","Ford Mondeo"],
["CAR TYPE","seden"],
["price","₹9.00 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(FordMondeo ,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 10 :
FordMustang =[["car name","Ford Mustang"],
["CAR TYPE","seden"],
["price","₹9.00 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(FordMustang ,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
else:
print("INVALID")
continue
if True:
if ram == 1:
continue
elif ram == 2:
break
elif ram == 3:
FORD()
print("ENTER THE CAR NUMBER TO COMPARE")
compare_cars = [["",],
["",],
["CAR TYPE",],
["ENGINE CC",],
["PRICE",],
]
while True:
compare = int(input("CAR NUMBER = "))
if compare >= 8:
print("THERE ARE ONLY SEVEN CARS")
continue
for i in tata_cars:
y=0
if i[0] != "CAR.NO":
if i[0] == compare:
c.insert(0,i)
print(c)
for j in c:
r = str (j[1])
u = str(j[3])
f = str(j[2])
for o in compare_cars:
if y == 1:
o.insert(0,"CAR NAME")
if y == 1:
o.insert(1,r)
if y == 2:
o.insert(1,u)
if y == 3:
o.insert(1,"1999CC")
if y == 4:
o.insert(1,f)
y=y+1
print("IF YOU WANT TO ADD ANOTHER CAR ")
print("1 -> YES")
print("2 -> NO")
q = int(input(" --> "))
if q == 1:
D = "2000CC"
continue
elif q == 2:
print(tabulate(compare_cars, tablefmt = "simple"))
a=2
break
elif choice == 2:
details = 0
continue
elif details == 3:
print("\t\t HYUNDAI CARS")
HYUNDAI()
print("1 - IF YOU WANT TO SEE FURTHER DETAILS ABOUT HYUNDAI CAR")
print("2 - CAR BRANDS")
if True:
print()
choice = int(input("--> "))
if choice == 1:
while True:
print()
HYUNDAI()
car = int(input("CHOOSE A CAR NO FROM ABOVE -> "))
if car == 1 :
tiago = [["car name","TIAGO"],
["CAR TYPE","seden"],
["price","₹8.91 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(tiago,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 2 :
altroz = [["car name","ALTROZ"],
["CAR TYPE","seden"],
["price","₹7.53 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(altroz,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 3 :
tigor = [["car name","TIGOR"],
["CAR TYPE","seden"],
["price","₹6.00 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(tigor,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 4 :
nexon = [["car name","NEXON"],
["CAR TYPE","seden"],
["price","₹8.91 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(nexon,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 5 :
harrier = [["car name","HARRIER"],
["CAR TYPE","seden"],
["price","₹8.91 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(harrier,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 6 :
safari = [["car name","SAFARI"],
["CAR TYPE","seden"],
["price","₹9.54 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(safari,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
elif car == 7 :
nexonev = [["car name","NEXON EV"],
["CAR TYPE","seden"],
["price","₹9.00 Lakhs Onwards"],
["Engine","1199 cc"],
["Power","72 - 84.82 bhp"],
["Transmissio","Manual / Automatic"],
["Mileage","19.0 - 19.01 kmpl"],
["Fuel","Petrol / CNG"],
["Airbags","2"],]
print(tabulate(nexonev,tablefmt ="fancy_grid" ))
print()
print("1 -> DETAILS ABOUT OTHER CARS IN TATA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
ram = int(input( "\t --> "))
else:
print("INVALID")
continue
if True:
if ram == 1:
continue
elif ram == 2:
break
elif ram == 3:
TATA()
print("ENTER THE CAR NUMBER TO COMPARE")
compare_cars = [["",],
["",],
["CAR TYPE",],
["ENGINE CC",],
["PRICE",],
]
while True:
compare = int(input("CAR NUMBER = "))
if compare >= 8:
print("THERE ARE ONLY SEVEN CARS")
continue
for i in tata_cars:
y=0
if i[0] != "CAR.NO":
if i[0] == compare:
c.insert(0,i)
for j in c:
r = str (j[1])
u = str(j[3])
f = str(j[2])
for o in compare_cars:
if y == 0:
o.insert(1,"CAR NAME")
if y == 1:
o.insert(1,r)
if y == 2:
o.insert(1,u)
if y == 3:
o.insert(1,"1999CC")
if y == 4:
o.insert(1,f)
y=y+1
print("IF YOU WANT TO ADD ANOTHER CAR ")
print("1 -> YES")
print("2 -> NO")
q = int(input(" --> "))
if q == 1:
D = "2000CC"
continue
elif q == 2:
print(tabulate(compare_cars,headers = "firstrow", tablefmt =
"psql"))
a=2
break
elif choice == 2:
details = 0
continue
elif details == 4:
print("\t\t HONDA CARS")
HONDA()
print("1 - IF YOU WANT TO SEE FURTHER DETAILS ABOUT HONDA CAR")
print("2 - CAR BRANDS")
if True:
print()
choice = int(input("--> "))
if choice == 1:
while True:
print()
HONDA()
car = int(input("CHOOSE A CAR NO FROM ABOVE -> "))
if car == 1 :
print("car 1")
print("1 -> DETAILS ABOUT OTHER CARS IN HONDA")
print("2 -> BRANDS")
print("3 -> ADD CARS TO COMPARE")
print()
ram = int(input( "\t --> "))
if ram == 1:
continue
elif ram == 2:
break
elif ram == 3:
HONDA()
print("ENTER THE CAR NUMBER TO COMPARE")
compare_cars = [["",],
["",],
["CAR TYPE",],
["ENGINE CC",],
["PRICE",],
]
while True:
compare = int(input("CAR NUMBER = "))
if compare >= 8:
print("THERE ARE ONLY SEVEN CARS")
continue
for i in tata_cars:
if i[0] != "CAR.NO":
if i[0] == compare:
c.insert(0,i)
print(c)
for j in c:
r = str (j[1])
u = str(j[3])
f = str(j[2])
y=0
for o in compare_cars:
if y == 0:
o.insert(1,"CAR NAME")
if y == 1:
o.insert(1,r)
if y == 2:
o.insert(1,u)
if y == 3:
o.insert(1,"1999CC")
if y == 4:
o.insert(1,f)
y=y+1
print("IF YOU WANT TO ADD ANOTHER CAR ")
print("1 -> YES")
print("2 -> NO")
q = int(input(" --> "))
if q == 1:
D = "2000CC"
continue
elif q == 2:
print(tabulate(compare_cars,headers = "firstrow", tablefmt =
"psql"))
a=2
break
elif choice == 2:
details = 0
continue
else:
print("INVALID NUMBER")
continue
elif consumer == 2:
print("\t\t OWNER")
EXPLANATIO
N
This programs deals with online car buying, selling, and compare it for better
choice. This program has some brands of cars and the brandsare TATA FORD
HONDA, HYUNDAI. The data types we have used are integer, string ,list The
functions ,loops, statements we have used are if while, for, def pop else int,
input, insert, append, isupper, islower ,isdigit The output will be first it ask
whether you are customer or owner, I you have a pressed customer then It will
ask your name, mobile number, address email then you have to select a brand
then it shows the cars from that brand if you want more details then again you
have to say the car number and it will show you the full details of the car then it
ask you if you want to buy it or not if you say no then it takes to the billing
section if not it will ask to exit app or to see brands or to add cars to compare
there is no restriction for adding cars to compare.