*This is my first Kata in the Ciphers series. This series is meant to test our coding knowledge.*

## Ciphers #1 - The 01 Cipher
This cipher doesn't exist, I just created it by myself. It can't actually be used, as there isn't a way to decode it. It's a hash. Multiple sentences may also have the same result.

## How this cipher works
It looks at the letter, and sees it's index in the alphabet, the alphabet being `a-z`, if you didn't know. If it is odd, it is replaced with `1`, if it's even, its replaced with `0`. Note that the index should start from 0. Also, if the character isn't a letter, it remains the same.

## Example

This is because `H`'s index is `7`, which is odd, so it is replaced by `1`, and so on.

Have fun (en)coding!

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def encode(s):
	

Solutions:
def encode(s):
	return ''.join((str(1 - ord(c) % 2) if c.isalpha() else c for c in s))


encode = lambda s: ''.join(((x, str(~ord(x) % 2))[x.isalpha()] for x in s))


import re

def encode(s):
	return re.sub('[a-zA-Z]', lambda m: str((ord(m.group()) + 1) % 2), s)


def encode(s):
	return ''.join((['1', '0'][ord(x) % 2] if x.isalpha() else x for x in s.lower()))


def encode(s):
	return ''.join([[i, '10'[ord(i) % 2]][i.isalpha()] for i in s])


def encode(s):
	return ''.join((str((ord(c.lower()) - 97) % 2) if c.isalpha() else c for c in s))


from string import ascii_lowercase as alphabet

def encode(s):
	POS = {v: i % 2 for (i, v) in enumerate(alphabet)}
	return ''.join((str(POS.get(c, c)) for c in s.lower()))


def encode(s):
	res = ''
	for i in range(len(s)):
		if s[i].isupper():
			if (ord(s[i]) - 65) % 2 == 0:
				res += '0'
			elif (ord(s[i]) - 65) % 2 == 1:
				res += '1'
		elif s[i].islower():
			if (ord(s[i]) - 97) % 2 == 0:
				res += '0'
			elif (ord(s[i]) - 97) % 2 == 1:
				res += '1'
		else:
			res += s[i]
	return res