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
62 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,62 @@ | ||
if __name__=__"main__" | ||
Print_hi("chatbot)" | ||
|
||
def isgreeting(userInput):) | ||
"""Returns indicating if user input was greeting""" | ||
greetings+("hello,Hey)") | ||
for word in greeting | ||
if word in userinput: | ||
reture true | ||
return false | ||
|
||
def respond(): | ||
"""print a response to user greeting""" | ||
responses =["hello,hey"] | ||
out = randomchoice(responses) | ||
print(out) | ||
|
||
def user_intentions(): | ||
interest=["period","menstral pains","cramps","weakness"] | ||
ask1=input(_"what brings you here?") | ||
for name in interest: | ||
if name is ask : | ||
print("""a period is the part of the menstrual cycle when a woman | ||
bleeds from her vagina for a few days.For most women | ||
this happens every 28days or so,but it is common for | ||
period to be more or less frequent than this,ranging | ||
from day 21 to day 40 of their cycle.""") | ||
|
||
def problem(): #This function will ask the user about their problem and will give solution | ||
interest1=["mentral pains","cramps","headace","heavy bleeding"] | ||
ask1=input("how can i help you today?") | ||
for y in interest1: | ||
if ask1 in y[0]: | ||
print("""mentual pain is common and a normalpart of your mentual cycle. | ||
most women get it at some point in their life.it is usually | ||
felt as painful muscle cramps in the tummy which spreads to | ||
the thighs.when that happens simply eat anything you can,drink | ||
a glass of milk and take some pain killers after that.""") | ||
elif ask1==y[1] or ask1==y[2]: | ||
print("""heavy bleeding is loosing 80ml in each period,having periods that | ||
that last long that 7 days and also loss so much blood.if this | ||
happens the best thing to do is to take NSAIDs that will really help.""") | ||
|
||
|
||
def medical_advide(): #Ask if user need more information or advice. | ||
a=input("do you want some more information?") | ||
b=["yes]"] | ||
for x in b: | ||
if x in a: | ||
print("providing contact information") | ||
else: | ||
pass | ||
|
||
def ending ():#last code | ||
q=input("hope it was helpful") | ||
q=="yes": | ||
print("""glad to be of help today | ||
thanks for stoping by.""") | ||
else: | ||
print("you have a good day.") | ||
|
||
|