Permalink
Browse files
Add files via upload
- Loading branch information
Showing
with
4 additions
and
1 deletion.
-
+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): |
|
|
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.