Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
GroupD3/joke_resp.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
16 lines (14 sloc)
1.07 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#made by Ridvan Karaman | |
joke_keywords = ("Tell me a joke.", "Can you tell me a joke?", "Tell me a joke,please.", | |
"I need a joke.", "Do you know any jokes?", " A joke would be nice") | |
joke_responces = ["Can a kangaroo jump higher than a house? \n Of course, a house doesn’t jump at all.", | |
" Anton, do you think I’m a bad mother? \n My name is Paul.", | |
"My dog used to chase people on a bike a lot. It got so bad, finally I had to take his bike away.", | |
"What is the difference between a snowman and a snowwoman? \n Snowballs.", | |
"My wife suffers from a drinking problem. \n Oh is she an alcoholic? \n No, I am, but she’s the one who suffers.", | |
"The inventor of AutoCorrect is a stupid mass hole. He can fake right off.", | |
"A naked women robbed a bank. Nobody could remember her face."] | |
def joke_check(sentence): | |
for word in sentence.words: | |
if word in joke_keywords: | |
return random.choice(joke_responces) |