Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import random | ||
answer = ["Is it how your friends call you?", "Is it how your mom call you?", "It is just your opinion"] | ||
words_ans = ("To be better than you", "To beat you", "To make silly conversations") | ||
|
||
'''Function to get ChatBot information related to "why?" questions. Giving particular answer to a user depends on the keyword which he used after "why."''' | ||
def sentence_why(sentence): | ||
if "why" in sentence: | ||
if "stupid" in sentence: | ||
print (random.choice(answer)) | ||
elif 'made' in sentence or 'create' in sentence or 'build' in sentence or 'exist' in sentence: | ||
print(random.choice(words_ans)) | ||
elif "answer" in sentence: | ||
print("I don't know the answer, because I am still learning.") | ||
elif "don't know" in sentence: | ||
print("Because I am still learning.") | ||
elif "dumb" in sentence: | ||
print("Is it how your friends call you?") | ||
elif "ask" in sentence: | ||
print("Because I am curious and I wanna know.") | ||
elif "sky is blue" in sentence: | ||
print( "A clear cloudless day-time sky is blue because molecules in the air\n scatter blue light from the sun more than they scatter red light.\n When we look towards the sun at sunset, we see red and orange colours\n because the blue light has been scattered out and away from the line of sight.") | ||
else: | ||
print("I am not sure if I understand what you mean.") | ||
|
||
|
||
|