In [ ]:
#Create your own version of the Mayoral Excuse Machine in Python that takes in a name and location,
#selects an excuse at random and prints an excuse (“Sorry, Richard, I was late to City Hall to meet you,
#I had a very rough night and woke up sluggish”)
#Use the “excuses.csv” in the Github repository
#Extra credit if you print the link to the story as well
In [4]:
import random
import pandas as pd
In [11]:
df = pd.DataFrame(pd.read_csv("data/excuse.csv"))
In [ ]:
you = input('Enter your name: ')
place = input('Enter location:')
excuse = random.choice(df['excuse'])
print("Sorry", you, "I was late to", place, "to meet you,", excuse+".")
In [ ]: