Skip to content
Permalink
master
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
def RandomRecipe():
import random
pip install pandas
import pandas as pd
df= pd.read_csv("RecipesDatabase.csv")
RecipeNames = df["Name"].tolist()
indexlist= df.index.tolist()
ID= random.choice(indexlist)
RecipeDescription= df["Description"].tolist()
print("The recipe you got was " + RecipeNames[ID])
print(RecipeDescription[ID])
state= 0
while state == 0:
happy=input("Are you happy with this recipe?")
if happy == "Yes":
gluten= df["GlutenProducts"].tolist()
dairy= df["DairyProducts"].tolist()
others= df["OtherProducts"].tolist()
instructions= df["Instructions"].tolist()
print(gluten[ID] + dairy[ID] + others[ID])
print(instructions[ID])
state= 1
if happy == "No":
print("Im sorry that you didn't like that recipe")
rsp=input("Would you like another random recipe?")
if rsp == "Yes":
RandomRecipe()
if rsp == "No":
print("I'm sorry that you didn't find what you wanted")
state= 1
RandomRecipe()