Need a different function for the python program display_ticket def display_tickets(): t = Texttable() tickets=cur.execute('''SELECT * FROM tickets''') for i in tickets: t.add_rows([['tid', 'actual_speed','posted_speed','age','violator_sex'],list(i)]) print() print(t.draw()) print() Need a different function for the python program add_ticket def add_tickets(): actual_speed=int(input("enter actual speed:")) posted_speed=int(input("enter posted speed:")) age=int(input("enter age:")) sex=input("Male or Female:") cur.execute('''INSERT INTO tickets(actual_speed,posted_speed,age,violator_sex) VALUES(?,?,?,?)''',(actual_speed,posted_speed,age,sex))
Need a different function for the python
def display_tickets():
t = Texttable()
tickets=cur.execute('''SELECT * FROM tickets''')
for i in tickets:
t.add_rows([['tid', 'actual_speed','posted_speed','age','violator_sex'],list(i)])
print()
print(t.draw())
print()
Need a different function for the python program add_ticket
def add_tickets():
actual_speed=int(input("enter actual speed:"))
posted_speed=int(input("enter posted speed:"))
age=int(input("enter age:"))
sex=input("Male or Female:")
cur.execute('''INSERT INTO tickets(actual_speed,posted_speed,age,violator_sex) VALUES(?,?,?,?)''',(actual_speed,posted_speed,age,sex))
con.commit()
If you'd like to see what thousands of traffic tickets look like, check out this link: https://www.twincities.com/2017/08/11/we-analyzed-224915-minnesota-speeding-tickets-see-what-we-learned/



Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images

Q1. The last post didnt include the items in the
def display_tickets():
t = Texttable()
tickets=cur.execute('''SELECT * FROM tickets''')
for i in tickets:
t.add_rows([['tid', 'actual_speed','posted_speed','age','violator_sex'],list(i)])
print()
print(t.draw())
print()
Q2. Also need a different function for the python program add_ticket below:
def add_tickets():
actual_speed=int(input("enter actual speed:"))
posted_speed=int(input("enter posted speed:"))
age=int(input("enter age:"))
sex=input("Male or Female:")
cur.execute('''INSERT INTO tickets(actual_speed,posted_speed,age,violator_sex) VALUES(?,?,?,?)''',(actual_speed,posted_speed,age,sex))
con.commit()
If you'd like to see what thousands of traffic tickets look like, check out this link: https://www.twincities.com/2017/08/11/we-analyzed-224915-minnesota-speeding-tickets-see-what-we-learned/










