Untitled

mail@pastecode.io avatar
unknown
plain_text
5 months ago
4.0 kB
0
Indexable


#It can recognize a limited range of emotions or conditions and respond to them finitely. Iā€™m a beginner in Python, and I guess I could write it shorter and better.I wrote it with my knowledge.


#---------------------Start--------------------#

print ("Describe your emotions by emojis :\n")

sent = input()
length = len(sent)
print (sent+"\n")

#----------------Defining emojis---------------#

happy=["šŸ˜‚","šŸ˜„","šŸ˜","šŸ˜€","šŸ˜ƒ","šŸ˜†","šŸ¤£"]
sad=["šŸ˜­","šŸ˜©","šŸ„²","šŸ˜ž","šŸ˜¢","šŸ˜”","šŸ˜£"]
angry=["šŸ˜”","šŸ˜¤","šŸ˜ ","šŸ¤¬","šŸ˜’","šŸ‘æ"]
relax=["šŸ˜Œ","šŸ˜‡","šŸ˜Š"]
tired=["šŸ˜Ŗ","šŸ„±","šŸ˜“","šŸ˜µ"]
scared=["šŸ˜±","šŸ˜Ø","šŸ˜°","šŸ«£"]
horny=["šŸ¤¤","šŸ˜ˆ","šŸ˜‹","šŸ˜›","šŸ«¦","šŸ‘…","šŸ’¦","šŸ‘","šŸ†"]
poker=["šŸ«¤","šŸ˜¶","šŸ˜","šŸ˜‘"]
sick=["šŸ¤®","šŸ¤¢","šŸ¤§","šŸ˜·","šŸ¤’"]
kiss=["šŸ˜˜","šŸ˜š","šŸ˜™","šŸ’‹"]


status=[False,False,False,False,False,False,False,False,False,False,False]

#----------------Checking emojis---------------#

for i in range(length):
 if sent[i] in happy: status[0] = True
 elif sent[i] in sad: status[1] = True
 elif sent[i] in angry: status[2] = True
 elif sent[i] in relax: status[3] = True
 elif sent[i] in tired: status[4] = True
 elif sent[i] in scared: status[5] = True
 elif sent[i] in horny: status[6] = True
 elif sent[i] in poker: status[7] = True
 elif sent[i] in sick: status[8] = True
 elif sent[i] in kiss: status[9] = True
 
 #--------Responding to combined emojis--------#
 
if status[1] and status[2] and all(f == False for f in status[3:]) and status[0] == False :
 print ("It seems you are angry and sad.šŸ˜¢")
 
elif status[0] and status[3] and all(f == False for f in status[1:3]) and all(f == False for f in status[4:]):
 print ("It seems you are happy and relax.ā˜ŗļø")
 
elif status[9] and (status[0] or status[3]) and all(f == False for f in status[1:3]) and all(f == False for f in status[4:9]):
 print ("I'm embarrassed!šŸ˜…šŸ™ˆ")
 
elif status[6] and (status[0] or status[9]) and all(f == False for f in status[1:6]) and all(f == False for f in status[7:9]):
 print ("Are you horny right now?šŸ˜‰šŸ˜‚")
 
elif status[1] and (status[4] or status[8]) and all(f == False for f in status[5:8]) and all(f == False for f in status[9:]) and all(f == False for f in status[2:4]) and status[0] == False :
 print ("Rest to get well and refresh.šŸ˜‰")

 #---------Responding to single emojis---------#
 
elif status[0] and all(f == False for f in status[1:]):
 print ("I'm happy that you are happy and laughing!šŸ˜Š")

elif status[1] and all(f == False for f in status[2:]) and status[0] == False :
 print ("I'm sorry about your sadness.šŸ˜ž")
 
elif status[2] and all(f == False for f in status[:2]) and all(f == False for f in status[3:]):
 print ("Calm down babe!šŸ˜Ø")
 
elif status[3] and all(f == False for f in status[:3]) and all(f == False for f in status[4:]):
 print ("It seems you are relax.ā˜ŗļø")
 
elif status[4] and all(f == False for f in status[:4]) and all(f == False for f in status[5:]):
 print ("Are you tired? Rest well.šŸ„°")
 
elif status[5] and all(f == False for f in status[:5]) and all(f == False for f in status[6:]):
 print ("Take a deep breath and stay in safe place.šŸ™")

elif status[6] and all(f == False for f in status[:6]) and all(f == False for f in status[7:]):
 print ("Are you horny?šŸ˜‚šŸ˜œ")
 
elif status[7] and all(f == False for f in status[:7]) and all(f == False for f in status[8:]):
 print ("Nothing special,huh?")
 
elif status[8] and all(f == False for f in status[:8]) and all(f == False for f in status[9:]):
 print ("Take your medicines and rest.šŸ«‚")
 
elif status[9] and all(f == False for f in status[:9]):
 print ("OMG...šŸ˜˜šŸ˜…šŸ™ˆšŸ™ˆ")
 
elif all(f == False for f in status[:]):
 print ("I didn't find any emoji / Undifined šŸ˜")

 #------Responding to conflicting emojis------#

else : 
 print ("I'm confused!šŸ˜µā€šŸ’« \nI have no idea!")
 
 
 #------------------The End------------------#
 
 
 
Leave a Comment