In [1]:
import pandas as pd
import random

In [2]:
def get_excuse(item):
    excuses = pd.read_csv(item)
    excuse = random.choice(excuses['excuse'])
    name = input('Enter the name of the person you were meeting:')
    location = input('Enter the place where you were supposed to go:')
    
    return "Sorry, " + name + ", I could not meet you at " + location + ", " + excuse

get_excuse("excuse.csv")


Enter the name of the person you were meeting:Mercy
Enter the place where you were supposed to go:Columbia
Out[2]:
'Sorry, Mercy, I could not meet you at Columbia, we waited 20 mins for an express only to hear there were major delays'

In [ ]:


In [ ]: