The wide mouth frog is particularly interested in the eating habits of other creatures.

He just can't stop asking the creatures he encounters what they like to eat. But then he meet the alligator who just LOVES to eat wide-mouthed frogs!

When he meets the alligator, it then makes a tiny mouth.

Your goal in this kata is to create complete the `mouth_size` method this method take one argument `animal` which corresponds to the animal encountered by frog. If this one is an `alligator` (case insensitive) return `small` otherwise return `wide`.

Difficulty: introductory

Starter code:

def mouth_size(animal):
	

Solutions:
def mouth_size(animal): 
    return 'small' if animal.lower() == 'alligator' else 'wide'

def mouth_size(animal): 
  return 'wide' if animal.lower() != 'alligator' else 'small'

def mouth_size(animal): 
    mouth = {'alligator':'small'}
    return mouth.get(animal.lower(), 'wide')

import re

def mouth_size(animal):
   return 'small' if  re.search('alligator', animal, re.IGNORECASE) else 'wide'

mouth_size = lambda s:"small" if (s.lower()=="alligator") else "wide"

mouth_size = lambda a: 'small' if a.lower() == 'alligator' else 'wide'

def mouth_size(s): return "small" if s.lower() == "alligator" else "wide"

def mouth_size(animal): 
  animal1 = animal.lower()
  if animal1 == 'alligator':
      return 'small'
  else:
      return 'wide'

def mouth_size(animal): 
    return "small" if "alligator" in animal.lower() else "wide"
  # code here


def mouth_size(animal): 
    if animal.lower() == 'alligator': return 'small'
    return 'wide'

def mouth_size(animal): 
  return 'small' if animal.upper() == 'ALLIGATOR' else 'wide'

def mouth_size(animal): 
  if animal.lower() == "alligator":
    return "small"
  else:
    return "wide"

mouth_size=lambda animal: ["wide","small"][animal.lower()=="alligator"]

def mouth_size(animal: str) -> str:
    """ The wide mouth frog or the small one? """
    return "small" if animal.lower() == "alligator" else "wide"

mouth_size = lambda animal: 'small' if animal.lower() == 'alligator' else 'wide'

def mouth_size(animal): 
    animal = animal.lower()
    return 'sm' + animal[:3] if animal[3:] == 'igator' else 'wide'

def mouth_size(animal): 
    if animal.casefold() == "alligator":
        return "small"
    else:
        return "wide"
print((mouth_size("alligator")))



  # code here


def mouth_size(animal): 
    return animal.lower() == 'alligator' and 'small' or 'wide'

def mouth_size(animal): 
  return ('wide', 'small')[animal.lower() == 'alligator']

def mouth_size(animal): 
    if animal.find('l')==1 or animal.find('L')==1:
        return 'small'
    else:
        return 'wide'
    


def mouth_size(animal): 
    new_animal = animal.lower()
    return "small" if new_animal == "alligator" else "wide"

def mouth_size(animal): 
    if animal.lower() == "alligator" or animal.lower() is "alligator!":
        return "small"
    return "wide"

small = ["alligator"]

def mouth_size(animal): 
    return "small" if animal.lower() in small else "wide"

def mouth_size(animal): 
  # code 
    if(animal.lower() == "alligator"):
        return "small"
    return "wide"

mouth_size = lambda x: ('wide', 'small')[x.lower() == 'alligator']

def mouth_size(animal): 
    return 'small' if (animal.lower()=='alligator' or animal.lower()=='alligator!') else 'wide'

def mouth_size(animal):
    animal_lower = animal.lower()
    if animal_lower == 'alligator':
        return 'small'
    else:
        return 'wide'

def mouth_size(animal): 
    if animal.lower() != "alligator":
        return "wide"
    elif animal.lower() == "alligator":
        return "small"


def mouth_size(animal):
    return "small" if animal.title() == "Alligator" else "wide"

def mouth_size(animal):
    animal = animal.title()
    if animal == 'Alligator':
        return 'small'
    else:
        return 'wide'

def mouth_size(animal): 
    state = "wide"
    if animal.lower() == "alligator":
        state = "small"
    return state

def mouth_size(animal): 
    x = 'alligator'
    if animal.casefold() == x.casefold():
        return 'small'
    else:
        return 'wide'

def mouth_size(animal): 
    # code here
    new_animal = animal.lower()
    if new_animal == "alligator":
        return "small"
    return "wide"

def mouth_size(animal): 
    if animal.upper() != 'ALLIGATOR' :
        return 'wide'
    else :
        return 'small'
  # code here


def mouth_size(animal): 
    return "wide" if animal.upper()!="ALLIGATOR" else "small"
  # code here


def mouth_size(animal): 
    result = ""
    if animal.lower() == "alligator":
        result = "small"
    else:
        result = "wide"
    return result

def mouth_size(animal): 
  return "small" if animal.lower() == "alligator".lower() else "wide"

def mouth_size(animal):
    " Рвем алигатору пасть"
    n = animal.lower()
    if n == "alligator":
        return "small"
    else:
        return "wide"

def mouth_size(animal): 
    if "alligator" == animal.lower():
        return "small"
    return "wide"

def mouth_size(animal): 
    animal=animal.lower()
    if animal == 'alligator' or animal == 'alligator!':
        return 'small'
    return 'wide'

def mouth_size(animal): 
    animal=animal.casefold()
    return "small" if "alligator"in animal else "wide"

def mouth_size(ani):
  animal = ani.lower()
  if animal == "alligator":
      return "small"
  elif animal == "toucan":
      return "wide"
  elif animal == "ant bear":
      return "wide"
  else :
      return "wide"

def mouth_size(animal): 
    #casefold makes case insensitive string matching
      if animal.casefold() == "alligator":
        return "small"
      else:
        return "wide"

def mouth_size(animal:str) -> str:
    if animal.lower() == "alligator":
        return "small"
    else:
        return "wide"


def mouth_size(animal): 
  return f'small' if animal.lower()=='alligator' else f'wide'

def mouth_size(animal): 
    if str(animal).lower() == "alligator":
        return "small"
    return "wide"

def mouth_size(animal): 
  new_animal = ""
  for letters in animal:
    if 65 <= ord(letters) <= 90:
        new_animal += chr(ord(letters)+32)
    else:
        new_animal += letters
  if new_animal == "alligator":
    return "small"
  return "wide"


import re

def mouth_size(animal):

  pattern = re.match(r'alligator', animal, re.I)
  if pattern:
    return "small"
  return "wide"


import re
def mouth_size(animal): 
  if re.search("alligator",animal,re.IGNORECASE):
      return "small"
  else:
      return "wide"
  # code here


def mouth_size(animal):
    x = animal.casefold()
    if x == 'alligator':
      return 'small'
    print(x)
    return 'wide'

def mouth_size(animal): 
  if animal.rstrip('!').lower() == 'alligator':
      return 'small'
  else:
      return 'wide' 

def mouth_size(animal):
  animal=animal.lower()
  print (animal)
  if animal==("alligator"):
      return ("small")
  else:
     return ("wide")



def mouth_size(animal): 
    return 'wide' if animal.lower().find('alligator') else 'small'


def mouth_size(animal): 
  
  animal=animal.lower()
  
  ergebnis="wide"
  
  if animal=="alligator":
     ergebnis="small"
     
  return ergebnis 

def mouth_size(x):
    x = x.lower()
    x = x.replace("!","")
    return "small" if x == "alligator"  else "wide"

def mouth_size(animal):
    animal = str(animal).lower()
    if animal=="alligator":
        return "small"
    else:
        return "wide"
s = mouth_size("alligator")
print(s)

def mouth_size(animal): 
  return "small" if (animal.lower()).capitalize() == "Alligator"  else "wide"

mouth_size = lambda a: ['wide', 'small']['tor' in a.casefold()]

def mouth_size(animal): 
  a = animal.lower()
  print(a)
  if a == "alligator": return "small"
  else: return "wide"

import re
def mouth_size(animal): 
    animalnew=animal.lower()
    if animalnew=='alligator':
        return "small"
    else:
        return "wide"
  # code here


def mouth_size(animal): 
  return ["small", "wide"][animal.lower()!="alligator"]

def mouth_size(animal): 
  anim = animal.lower()
  if anim == "alligator":
      return "small"
  else:
      return "wide"

def mouth_size(animal):
    if animal.lower() == 'alligator':
        a='small'
    else:
        a='wide'
    return a

def mouth_size(animal):
    if str(animal).lower() != "alligator":
        return ("wide")
    else:
        return("small")
  # code here


def mouth_size(animal):
    animaL = animal.lower()
    if animaL == 'alligator':
        return 'small'
    else:
        return 'wide'

def mouth_size(animal): 
  if animal.lower() == "alligator" or animal.lower() == "alligator!":
    return "small"
  else:
    return "wide"

def mouth_size(animal):
  ani="alligator".strip("!")
  return "small" if animal.lower() == ani else "wide"

def mouth_size(animal): 
  if animal.title() == 'Alligator':
      return "small"
  else:
      return "wide"

def mouth_size(animal): 
  # code here
  a=len('alligator')
  b=len(animal)
  return 'wide' if b!=a else 'small'

def mouth_size(animal): 
    animal = animal.lower()
    if animal != "alligator":
        return "wide"
    return "small"

def mouth_size(animal):
  low=animal.lower()
  if low == "alligator":
      return "small"
  else:
      return "wide"

def mouth_size(animal): 
    return "wide" if "alligator" != animal.lower() else "small"

def mouth_size(animal): 
    alligator = "alligator"
    if animal.lower()  == alligator.lower(): 
      return "small"
    else: 
      return "wide"

def mouth_size(animal): 
  return "wide" if not animal.lower() in "alligator" else "small" 

def mouth_size(animal): 
    print(animal.capitalize())
    if animal.capitalize() == 'Alligator':
        return 'small'
    else:
        return 'wide'

def mouth_size(animal): 
  if animal.upper() == "alligator".upper():
      return "small"
      
  return "wide"

def mouth_size(animal):
    s = animal.lower()
    print(s)
    if s != 'alligator':
        return "wide"
    else:
        return "small"

def mouth_size(animal): 
  if animal.lower() == "alligator":
      mouth = "small"
  else:
      mouth = "wide"
  return mouth


def mouth_size(animal): 
  if animal.lower() != "alligator":
#       print (animal.lower())
      return "wide"
  else: return "small"

def mouth_size(animal): 
  newAnimal = animal.lower()
  if newAnimal == "alligator":
      return "small"
  else:
      return "wide"

def mouth_size(animal):
    aniLow = animal.lower()
    return "small" if aniLow == "alligator" else "wide"

'''🐊🐊🐊'''
def mouth_size(animal): 
    return "small" if animal.lower() == "alligator" else "wide"

def mouth_size(animal): 
    
    ret = 'wide'
    if animal.lower() == 'alligator':
        ret = 'small'

    return ret


def mouth_size(animal: str) -> str: 
  # code here
    if animal.lower() == 'alligator':
        return 'small'
    return 'wide'

def mouth_size(animal): 
    return "small" if ''.join([x.lower() for x in animal]) == "alligator" else "wide"

def mouth_size(animal): 
  if "alligator" in animal.casefold():
      return "small"
  else:
      return "wide"

def mouth_size(animal):
    lower_letters = animal.lower()
    if lower_letters == "alligator":
        return "small"
    else:
        return "wide"

def mouth_size(animal): 
  # code here
  if animal.lower()=="alligator" or animal=="wide":
      return "small"
  return "wide"

mouth_size = lambda n: "small" if n.casefold()=="alligator" else "wide"

def mouth_size(animal): 
    x = 'alligator'
    if animal.lower() == x:
        return 'small'
    else:
        return 'wide'



def mouth_size(animal):
  if len(animal) <  9: 
   return 'wide'
  elif len(animal) > 9: 
   return 'wide' 
  else: 
   return 'small' 
  # code here


def mouth_size(animal): 
  if animal.upper() == 'alligator'.upper():
      return 'small'
  else:
      return 'wide'

def mouth_size(animal): 
    mouth = ""
    if animal.casefold() != "alligator":
        mouth = "wide"
    else:
        mouth = "small"
    return mouth

def mouth_size(animal):
    a=animal.upper()
    if a=='ALLIGATOR':
        return 'small'
    else:
        return'wide'
  # code here


def mouth_size(animal):
  s = 'alligator'
  return 'small' if animal.lower() == s else 'wide'

def mouth_size(animal): 
  if animal.lower() == 'alligator':
      return 'small'
  else:
      return 'wide'
mouth_size("alligator")

def mouth_size(animal):
  new = animal.lower()
  if 'alligator'in new:
      return 'small'
  elif 'alligator!' in new:
      return 'small'
  else:
      return 'wide'

def mouth_size(animal): 
  result = ""
  animal_recase = animal.lower() #to make all forms of alligator 'readable'
  if animal_recase == "alligator":
      result = "small"
  else:
      result = "wide"
  return result   

def mouth_size(animal): 
    c = animal.lower()
    a = "small"
    b = "wide"
    if c == "alligator":
        return a
    else:
        return b
  # code here


def mouth_size(x):
    if x.lower() == 'alligator': return 'small'
    else: return 'wide'