This is a follow up from my kata The old switcheroo

Write
```python
def encode(str)
```
that takes in a string ```str``` and replaces all the letters with their respective positions in the English alphabet.

```python
encode('abc') == '123'   # a is 1st in English alpabet, b is 2nd and c is 3rd
encode('codewars') == '315452311819'
encode('abc-#@5') == '123-#@5'
```
String are case sensitive.

Difficulty: introductory

Starter code:

def encode(string):
	

Solutions:
def encode(string):
    return ''.join(str(ord(c.upper())-64) if c.isalpha() else c for c in string)

def encode(string):
  return ''.join(str(ord(c)-96) if c.isalpha() else c for c in string.lower())

def encode(s):
    return ''.join(str(ord(x) - ord('a') + 1) if x.isalpha() else x for x in s.lower())

from string import ascii_uppercase, ascii_lowercase

D = {c:str(i) for string in (ascii_uppercase, ascii_lowercase) for i,c in enumerate(string, 1)}

def encode(string):
    return ''.join(D.get(c, c) for c in string)

def encode(stg):
    return "".join(str(ord(c) - 96) if "a" <= c <= "z" else c for c in stg.lower())

from string import ascii_lowercase as letters


def encode(string):
    return ''.join(str(letters.find(char)+1) if char in letters else char for char in string.lower())

BASE = ord('A') - 1

def encode(string):
    return ''.join(str(ord(c)-BASE) if c.isalpha() else c for c in string.upper())

def encode(string):
    string = string.lower()
    alph = 'abcdefghijklmnopqrstuvwxyz'
    st = []
    for l in string:
        if l.isalpha():
            st.append(alph.find(l)+1)
        else:
            st.append(l)
    return ''.join(map(str,st))

def encode(string):
    return ''.join(str(ord(i.lower()) - 96)  if i.isalpha() else i for i in string)

import re

def encode(string):
    return re.sub(r'[a-z]', lambda m: str(ord(m.group()) - ord('a') + 1), string.lower())