Skip to content
Permalink
196c1205be
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
18 lines (16 sloc) 499 Bytes
#Made by Andris Jansons
def isGreeted(text):
"""Checks if user greets the program and if the greeting is formal or not"""
KEYWORDS_FORMAL = "hi, hello".split(", ")
KEYWORDS_UNFORMAL = "hey, heya, aloha, wassup, hola, ola, heyy, sup, yo".split(", ")
greeted = False
formal = False
for word in text:
if word in KEYWORDS_FORMAL:
formal = True
greeted = True
break
elif word in KEYWORDS_UNFORMAL:
greeted = True
break
return greeted, formal # Both booleans