In Spanish, the conjugated verb changes by adding suffixes and according to the person we're talking about. There's something similar in English when we talk about "She", "He"or "It" (3rd person singular):

With the verb "run":

**He / She / It runS**


As you can see, the rule (at least with regular verbs) is to add the suffix  "-s" in the 3rd person singular. In Spanish it works the same way but we need to remove the **infinitive suffix** and add a specific suffix to all the others persons (I, You, He/She/It, We, You, They).

Verbs in Spanish and the infinitive suffix.
--

In Spanish we assume a verb is on its infitive form when it has one of the infinitives suffixes (**AR**, **ER** or **IR**) at the end:

- Com**er** -> to eat

- Camin**ar** -> to walk

- Viv**ir** -> to live

## How to conjugate


For conjugating in Spanish, we need to remove the infinitive suffix (**ar**, **er** *or* **ir**) and add the personal suffixes corresponding to the person we're talking to. In this kata we'll conjugate the verbs to its **presente indicativo** (simple present) form.

Personal suffixes
--
The personal suffixes changes depending of the **Infinitive suffix**.

If the infinitive suffix is **AR** the personal suffixes are:

- first person singular (Yo / I): -**o**
- second person singular (Tú / You): -**as**
- third person singular (Él, Ella / He, She): -**a**
- first person plural (Nosotros / We): -**amos**
- second person plural (Vosotros / You): -**áis**
- third person plural (Ellos / They): -**an**

If the infinitive suffix is **ER**:
- first person singular (Yo / I): -**o**
- second person singular (Tú / You): -**es**
- third person singular (Él, Ella / He, She): -**e**
- first person plural (Nosotros / We): -**emos**
- second person plural (Vosotros / You): -**éis**
- third person plural (Ellos / They): -**en**

If the infinitive suffix is **IR**:
- first person singular (Yo / I): -**o**
- second person singular (Tú / You): -**es**
- third person singular (Él, Ella / He, She): -**e**
- first person plural (Nosotros / We): -**imos**
- second person plural (Vosotros / You): -**ís**
- third person plural (Ellos / They): -**en**

## Conjugating 
Steps for conjugating:
1. Remove the infinitive suffix (ar, er, ir)
2. And add the personal suffixes
- Example: verb **Caminar** (to walk)
  - Camin**o** (I walk)
  - Camin**as** (You walk)
  - Camin**a** (He walks)
  - Camin**amos** (We walk)
  - Camin**áis** (You guys walk)
  - Camin**an** (They walk)
- Example: verb **Comer** (to eat):
  - Com**o** (I eat)
  - Com**es** (You eat)
  - Com**e** (He, She eats)
  - Com**emos** (We eat)
  - Com**éis** (You guys eat)
  - Com**en** (They eat)
- Example: verb **Vivir** (to live):
  - Viv**o** (I live)
  - Viv**es** (You live)
  - Viv**e** (He, She lives)
  - Viv**imos** (We live)
  - Viv**ís** (You guys live)
  - Viv**en** (They live)
  
## Your Task

You need to write a function called **conjugate** which will return an object with a spanish verb conjugated. The object must look like this:

```
{
  "comer": [
    "como",
    "comes",
    "come",
    "comemos",
    "coméis",
    "comen"
  ]
}

```

Where the key is the verb in its original form (infinitive form) and its value will be an array with the conjugations.

Another example:
```
{
  "vivir": [
    "vivo",
    "vives",
    "vive",
    "vivimos",
    "vivís",
    "viven"
  ]
}

```

## Notes:
1. The conjugations must be in this order:
```
{
    verb: [
      "first person singular",
      "second person singular",
      "third person singular",
      "first person plural",
      "second person plural",
      "third person plural"
    ]
}
```
2.Don't use `JSON.stringify(obj, null, 2)` because the "presentation" of the object isn't important.

3.Don't use accents in Python version


 **Buena suerte!**
---

Difficulty: introductory

Starter code:

def conjugate(verb):
	

Solutions:
SUFFIXES = {'a': ['o', 'as', 'a', 'amos', 'ais', 'an'],
            'e': ['o', 'es', 'e', 'emos', 'eis', 'en'],
            'i': ['o', 'es', 'e', 'imos', 'is',  'en']}

def conjugate(verb):
    return {verb: [verb[:-2] + s for s in SUFFIXES[verb[-2]]]}

def conjugate(verb):
    d = {'ar': ['o', 'as', 'a', 'amos', 'ais', 'an'],
         'er': ['o', 'es', 'e', 'emos', 'eis', 'en'],
         'ir': ['o', 'es', 'e', 'imos', 'is', 'en']}
    return {verb: [verb[:-2] + v for v in d[verb[-2:]]]}

personal_suffixes = {
    "ar": ["o", "as", "a", "amos", "ais", "an"],
    "er": ["o", "es", "e", "emos", "eis", "en"],
    "ir": ["o", "es", "e", "imos", "is", "en"],
}

def conjugate(verb):
    base, group = verb[:-2], verb[-2:]
    suffixes = personal_suffixes[group]
    return {verb: [f"{base}{suffix}" for suffix in suffixes]}

def conjugate(verb):
    root, oldSuffix = verb[:-2], verb[-2:]
    newSuffix = {"ar": ["o", "as", "a", "amos", "ais", "an"],
                 "er": ["o", "es", "e", "emos", "eis", "en"],
                 "ir": ["o", "es", "e", "imos", "is", "en"]}
    answer = {verb: []}
    for ns in newSuffix[oldSuffix]:
        answer[verb].append(root + ns)
    return answer

def conjugate(verb):
    conj = {'ar':('o', 'as', 'a', 'amos', 'ais', 'an'),
            'er':('o', 'es', 'e', 'emos', 'eis', 'en'),
            'ir':('o', 'es', 'e', 'imos', 'is', 'en'),}
    return {verb : [verb[:-2] + c for c in conj[verb[-2:]]]}

conjugators = {
    'ar': ['o', 'as', 'a', 'amos', 'ais', 'an'],
    'er': ['o', 'es', 'e', 'emos', 'eis', 'en'],
    'ir': ['o', 'es', 'e', 'imos', 'is', 'en'],
}

def conjugate(verb):
    root, suffix = verb[:-2], verb[-2:]
    cs = conjugators[suffix]
    return {verb: [root+c for c in cs]}

def conjugate(verb):
    conjugation = verb[-2:]
    
    if conjugation == "ar":
        return { verb : [verb[:-2] + "o", verb[:-2] + "as", verb[:-2] + "a", verb[:-2] + "amos", verb[:-2] + "ais", verb[:-2] + "an"] }
    elif conjugation == "er":
        return { verb : [verb[:-2] + "o", verb[:-2] + "es", verb[:-2] + "e", verb[:-2] + "emos", verb[:-2] + "eis", verb[:-2] + "en"] }
    elif conjugation == "ir":
        return { verb : [verb[:-2] + "o", verb[:-2] + "es", verb[:-2] + "e", verb[:-2] + "imos", verb[:-2] + "is", verb[:-2] + "en"] }

def conjugate(verb):
    base, infinitive_suffix = verb[:-2], verb[-2:]
    patterns = {'ar': ['o', 'as', 'a', 'amos', 'ais', 'an'], 'er': ['o', 'es', 'e', 'emos', 'eis', 'en'],
                'ir': ['o', 'es', 'e', 'imos', 'is', 'en']}
    conjugations = [base+suffix for suffix in patterns[infinitive_suffix]]
    return {verb: conjugations}

def conjugate(verb):
    i=0
    conj=""
    while i<len(verb)-2:
        conj+=verb[i]
        i+=1
    arr=[]
    vow=verb[-2]
    arr.append(conj+"o")
    if vow=="a":
        arr.append(conj+"as")
        arr.append(conj+"a")
    else:
        arr.append(conj+"es")
        arr.append(conj+"e")
    if vow == "a":
        arr.append(conj+"amos")
        arr.append(conj+"ais")
        arr.append(conj+"an")
    elif vow == "e":
        arr.append(conj+"emos")
        arr.append(conj+"eis")
        arr.append(conj+"en")
    else:
        arr.append(conj+"imos")
        arr.append(conj+"is")
        arr.append(conj+"en")
    obj={verb:arr}
    return obj

def conjugate(v):
    h=i=v[:-1]
    if h[-1]=='i':
        h=h[:-1]+'e'
        i=v[:-2]
    return {v:[v[:-2]+'o',h+'s',h,v[:-1]+'mos',i+'is',h+'n']}