Skip to content
Permalink
Browse files

Add files via upload

added fix for "I am" bug
  • Loading branch information
cholis committed Nov 22, 2017
1 parent 13e7801 commit 26e739017ee3f19fcba759bc30aa382dacc8bead
Showing with 4 additions and 1 deletion.
  1. +4 −1 Get_Functions.py
@@ -12,7 +12,7 @@

#=========================================================================================================

def getName(sentence): #Jasper, Richard
def getName(sentence): #Jasper, Richard, Suraj
"""get the name of the user from the inputed sentence"""
userWords = sentence.lower()
userWords = userWords.split()
@@ -23,6 +23,9 @@ def getName(sentence): #Jasper, Richard
# "Howdy, I'm called ____"
# Order: Greeting -> pronoun -> Name -> question (optional)
# eg. "Hello, I'm Jasper. How are you?"

if (userWords[0] in greetings): #the added code that stops iam from being added into the name if 2 greeting are added
userWords.pop(0) #pop and not .remove because


if (userWords[0] == "i" and len(userWords) > 1):

0 comments on commit 26e7390

Please sign in to comment.
You can’t perform that action at this time.