Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

Students also viewed these Databases questions