In [2]:
import pandas as pd
import random
In [47]:
excuses = pd.read_csv('data/excuse.csv')
# excuses.head()
In [73]:
excuses_dict = excuses.to_dict('records')
# excuses_dict
In [72]:
def excuse_sentence(name, location):
randomly_chosen_excuse = random.choice(excuses_dict)
sentence = "Sorry, " + name + ", I'm late to meeting you at " + location + ", " + randomly_chosen_excuse['excuse'] + ". To make up for being late, here's something to read while you are waiting " + randomly_chosen_excuse['hyperlink']
return sentence
excuse_sentence(input("Please type the name of the person you planned to meet:"), input("Tell me where you planned to meet:"))
Out[72]:
In [ ]: