""" Given a string which starts with 'which', returns a string which is an answer to the user's question"""
if"popular programming language"insentenceor"best known programming language"insentence:
response="Java is top pick as one of the most popular programming languages, used for building server-side applications to video games and mobile apps."
@@ -246,7 +246,7 @@ def executeWhich(sentence):
returnresponse
defexecuteWho(sentence):
defexecuteWho(sentence):#Delia
""" Given a string which starts with 'who', returns a string which is an answer to the user's question"""
if"are you"insentence:
response="I'm Jeff, an awesome chatbot."
@@ -269,7 +269,7 @@ def executeWho(sentence):
returnresponse
defexecuteDo(sentence):
defexecuteDo(sentence):#Delia
""" Given a string which starts with 'do', returns a string which is an answer to the user's question"""
sentenceParse=sentence.split()
if"like"insentenceor"love"insentence:
@@ -293,7 +293,7 @@ def executeDo(sentence):
returnresponse
defexecuteHow(sentence):
defexecuteHow(sentence):#Delia
""" Given a string which starts with 'how', returns a string which is an answer to the user's question"""
if"old are you"insentence:
response="I'm five weeks old."
@@ -314,7 +314,7 @@ def executeHow(sentence):
defexecuteTell(sentence):
defexecuteTell(sentence):#Delia
""" Given a string which starts with 'tell', returns a string which is an answer to the user's requirement"""
if"time"insentence:
response="The time is: "+str(now.hour) +str(":") +str(now.minute) +str(":") +str(now.second)
@@ -339,7 +339,7 @@ def executeTell(sentence):
returnresponse
defexecuteWhat(sentence):
defexecuteWhat(sentence):#Delia
""" Given a string which starts with 'what', returns a string which is an answer to the user's question"""