Question
Revise to make it more efficient and can be stored in a table or excel import sqlite3 def create_account(): name = input(Please enter your name:
Revise to make it more efficient and can be stored in a table or excel
import sqlite3
def create_account():
name = input("Please enter your name: ")
age = input("Please enter your age: ")
gender = input("Please enter your gender: ")
address = input("Please enter your address: ")
symptoms = input("Please enter any symptoms you have: ")
security_issues = input("Please enter any security issues you have: ")
conn = sqlite3.connect('accounts.db')
c = conn.cursor()
c.execute("INSERT INTO accounts (name, age, gender, address, symptoms, security_issues) VALUES (?, ?, ?, ?, ?, ?)", (name, age, gender, address, symptoms, security_issues))
conn.commit()
conn.close()
print("Account created successfully!")
logout()
def logout():
logout = input("Do you want to log out? (yes/no)")
if logout.lower() == "yes":
print("You have been logged out.")
else:
print("You are still logged in.")
create_account()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started