Skip to content
Permalink
a5256e7a02
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
31 lines (21 sloc) 981 Bytes
import sqlite3
conn = sqlite3.connect('chatbot.db')
c = conn.cursor()
def restaurants():
response = input("Who are you going out to eat with? \n")
words = response.split(" ")
if "boyfriend" in words or "girlfriend" in words:
print("The restaurants below have been selected as being suited for you.")
for row in c.execute('SELECT name FROM restaurants WHERE mood = "Romantic" '):
print(row)
elif "friend" in words or "friends" in words:
print("The restaurants below have been selected as being suited for you.")
for row in c.execute('SELECT name FROM restaurants WHERE mood = "Casual" '):
print(row)
elif "myself" in words or "alone" in words:
print("The restaurants below have been selected as being suited for you.")
for row in c.execute('SELECT name FROM restaurants WHERE mood = "Cosy" '):
print(row)
else:
print("This is not an option")
restaurants()