Skip to content
Permalink
Browse files
  • Loading branch information
hortonr6 committed Nov 3, 2017
2 parents fb42c1b + 3d2d6b7 commit 19965a0cc59285b93d768c11d89e53b951a26ace
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
@@ -14,15 +14,7 @@ randomStuff = ["Cherophobia is the fear of fun","A flock of crows is called a mu

def getName(sentence):
"""get the name of the user from the inputed sentence"""
#first - getting rid of unwanted chars
unwantedChar = [".","'","!","?",","]
newSentence = ""
for char in sentence:
if char not in unwantedChar:
newSentence = newSentence + char
newSentence = newSentence.lower() # makes all letters into lowercase - much easier and more efficient

userWords = newSentence.split() #the sentence is split up into words and put into a list
userWords = sentence.split() #the sentence is split up into words and put into a list

# ways of introduction:
# "Hello, my name is ___"
@@ -0,0 +1,9 @@
Below are the job roles for this week. Please add what you plan to work on so nothing gets duplicated.

Everyone: Flowcharts for the code you have made so far and for the code you are currently working on

Suraj: Use opentDB API to create a pub quiz interaction
Delia:
Andre:
Jasper:
Richard: Make the GUI look less awful
Binary file not shown.
@@ -8,13 +8,19 @@ def determineUserInput(sentence):
"""determines what the user asks and responses accordingly"""
response = ""
sentence = sentence.lower()
#first - getting rid of unwanted chars
unwantedChar = [".","'","!","?",","]

for char in unwantedChar:
sentence = sentence.replace(char," ")

sentenceParse = sentence.split()

if sentenceParse[0] in questionStarters: # ------------- execute the "what is" code here ---------------
response = respondQuestion(sentence), 2
elif sentenceParse[0] in greetings:
response = getName(sentence), 1
elif sentence[0] in "abcd":
elif sentenceParse[0] in "abcd":
response = sentence, 3
else:
response = sentence, 0

0 comments on commit 19965a0

Please sign in to comment.