In this kata you will have to change every letter in a given string to the next letter in the alphabet. You will write a function `nextLetter` to do this. The function will take a single parameter `s` (string).

Examples:

```
"Hello" --> "Ifmmp"

"What is your name?" --> "Xibu jt zpvs obnf?"

"zoo" --> "app"

"zzZAaa" --> "aaABbb"
```

Note: spaces and special characters should remain the same. Capital letters should transfer in the same way but remain capitilized.

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def next_letter(s):
	

Solutions:
def next_letter(string):
	return ''.join((chr(ord(c) + (-25 if c in 'zZ' else 1)) if c.isalpha() else c for c in string))


def next_letter(s):
	return s.translate(str.maketrans('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'bcdefghijklmnopqrstuvwxyzaBCDEFGHIJKLMNOPQRSTUVWXYZA'))


from string import ascii_lowercase as aLow
tr = aLow[1:] + 'a'
TABLE = str.maketrans(aLow + aLow.upper(), tr + tr.upper())

def next_letter(s):
	return s.translate(TABLE)


table = {o + c: c + (o + 1) % 26 for c in (97, 65) for o in range(26)}

def next_letter(stg):
	return stg.translate(table)


from string import ascii_lowercase as L, ascii_uppercase as U

def next_letter(s):
	return s.translate(str.maketrans(L + U, L[1:] + L[0] + U[1:] + U[0]))


from string import ascii_letters as a, ascii_lowercase as al, ascii_uppercase as au

def next_letter(string):
	return string.translate(str.maketrans(a, al[1:] + al[0] + au[1:] + au[0]))


from string import ascii_lowercase as low, ascii_uppercase as up

def next_letter(s):
	return s.translate(str.maketrans(low + up, low[1:] + low[0] + up[1:] + up[0]))


from string import ascii_lowercase as l, ascii_uppercase as u
next_letter = lambda s: s.translate(str.maketrans(l + u, l[1:] + l[0] + u[1:] + u[0]))