When provided with a letter, return its position in the alphabet.

Input :: "a"

Ouput :: "Position of alphabet: 1"

`This kata is meant for beginners. Rank and upvote to bring it out of beta`

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def position(alphabet):
	

Solutions:
def position(alphabet):
	return 'Position of alphabet: {}'.format(ord(alphabet) - 96)


def position(alphabet):
	return 'Position of alphabet: %s' % ('abcdefghijklmnopqrstuvwxyz'.find(alphabet) + 1)


from string import ascii_lowercase

def position(char):
	return 'Position of alphabet: {0}'.format(ascii_lowercase.index(char) + 1)


def position(letter):
	return 'Position of alphabet: %d' % (ord(letter) - 96)


def position(alpha):
	return f'Position of alphabet: {ord(alpha) - 96}'


from string import lowercase

def position(letter):
	return 'Position of alphabet: %d' % (1 + lowercase.index(letter))


def position(alphabet):
	return 'Position of alphabet: ' + str(ord(alphabet) - ord('a') + 1)


position = lambda a: 'Position of alphabet: {}'.format(ord(a) - 96)


def position(a):
	return f'Position of alphabet: {ord(a) - 96}'


import string

def position(alphabet):
	return f'Position of alphabet: {string.ascii_letters.index(alphabet.lower()) + 1}'


def position(alphabet):
	abc = 'abcdefghijklmnopqrstuvwxyz'
	pos = abc.index(alphabet) + 1
	return 'Position of alphabet: ' + str(pos)


def position(alphabet):
	alph_list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	for i in range(0, 26):
		if alphabet == alph_list[i]:
			j = i + 1
			return 'Position of alphabet: ' + str(j)


position = lambda l: 'Position of alphabet: ' + str('abcdefghijklmnopqrstuvwxyz'.index(l) + 1)


def position(alphabet):
	return 'Position of alphabet: ' + str(ord(alphabet) - 96)


import string
position = lambda a: 'Position of alphabet: {}'.format(string.ascii_lowercase.index(a) + 1)


def position(alphabet):
	return f'Position of alphabet: {ord(alphabet[0]) - 96}'


abc = {'a': '1', 'b': '2', 'c': '3', 'd': '4', 'e': '5', 'f': '6', 'g': '7', 'h': '8', 'i': '9', 'j': '10', 'k': '11', 'l': '12', 'm': '13', 'n': '14', 'o': '15', 'p': '16', 'q': '17', 'r': '18', 's': '19', 't': '20', 'u': '21', 'v': '22', 'w': '23', 'x': '24', 'y': '25', 'z': '26'}

def position(alphabet):
	return f'Position of alphabet: {abc.get(alphabet)}'


def position(ch):
	return f"Position of alphabet: {ord(ch) - ord('a') + 1}"


def position(alphabet):
	result = ord(alphabet) - 96
	return f'Position of alphabet: {result}'


import string

def position(alphabet):
	d = {}
	s = string.ascii_lowercase
	c = 1
	for i in s:
		d[i] = c
		c += 1
	return f'Position of alphabet: {d.get(alphabet)}'


def position(a):
	return f"Position of alphabet: {'abcdefghijklmnopqrstuvwxyz'.index(a) + 1}"


def position(letter):
	import string
	alpha = string.ascii_lowercase
	return 'Position of alphabet: {}'.format(alpha.index(letter) + 1)


from string import ascii_lowercase as lc

def position(alphabet):
	return f'Position of alphabet: {lc.find(alphabet.lower()) + 1}'


def position(alphabet):
	alph = list('abcdefghijklmnopqrstuvwxyz')
	return f'Position of alphabet: {alph.index(alphabet) + 1}'


def position(alphabet):
	a = 'abcdefghijklmnopqrstuvwxyz'
	x = list(map(lambda x: a[x], range(len(a)))).index(alphabet) + 1
	return 'Position of alphabet: ' + str(x)


def position(a):
	return 'Position of alphabet: ' + str(list('abcdefghijklmnopqrstuvwxyz').index(a) + 1)


position = lambda letter: f"Position of alphabet: {'abcdefghijklmnopqrstuvwxyz'.index(letter) + 1}"


def position(alphabet):
	char = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
	char_num = list(zip(char, nums))
	for (i, j) in char_num:
		if i == alphabet:
			return 'Position of alphabet: ' + str(j)


def position(alphabet):
	a_l = 'abcdefghijklmnopqrstuvwxyz'
	return f'Position of alphabet: {a_l.index(alphabet) + 1}'


def position(alphabet):
	alpha = ['', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	if alphabet in alpha:
		return f'Position of alphabet: {alpha.index(alphabet)}'


import string

def position(alpha):
	alphabet = string.ascii_lowercase
	return f'Position of alphabet: {alphabet.find(alpha) + 1}'


import string

def position(pos):
	alphabet = string.ascii_lowercase
	return f'Position of alphabet: {alphabet.index(pos) + 1}'


alp = 'abcdefghijklmnopqrstuvwxyz'

def position(alphabet):
	return f'Position of alphabet: {alp.index(alphabet) + 1}'


def position(letter):
	msg = 'Position of alphabet: '
	return f"{msg}{'abcdefghijklmnopqrstuvwxyz'.find(letter) + 1}"


def position(alphabet):
	alphabet.lower()
	al = 'abcdefghijklmnopqrstuvwxyz'
	ind = al.index(alphabet)
	return 'Position of alphabet: {}'.format(ind + 1)


def position(alphabet):
	import string
	a = string.ascii_lowercase.index(alphabet)
	b = a + 1
	c = str(b)
	return 'Position of alphabet: ' + c


def position(ch):
	for i in range(26):
		if ch.lower() == 'abcdefghijklmnopqrstuvwxyz'[i]:
			return f'Position of alphabet: {i + 1}'
	return False


def position(alphabet):
	position = ord(alphabet.lower()) - 96
	return f'Position of alphabet: {position}'


def position(alphabet):
	abcd = 'abcdefghijklmnopqrstuvwxyz'
	pos = abcd.index(alphabet)
	return 'Position of alphabet: {}'.format(pos + 1)


import string

def position(alphabet):
	ab = dict(zip(string.ascii_lowercase, range(1, 27)))
	return f'Position of alphabet: {ab.get(alphabet)}'


def position(alphabet):
	import string
	x = list(string.ascii_lowercase)
	return f'Position of alphabet: {x.index(alphabet) + 1}'


alf = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

def position(alphabet):
	nonlocal alf
	return f'Position of alphabet: {alf.index(alphabet) + 1}'


def position(alphabet):
	import string
	characters = {char: str(idx) for (idx, char) in enumerate(string.ascii_lowercase, 1)}
	return f'Position of alphabet: {characters[alphabet]}'


def position(alphabet):
	num = ord(alphabet)
	num -= 96
	return f'Position of alphabet: {num}'


from string import ascii_lowercase as al

def position(alphabet):
	return f'Position of alphabet: {[pos for (pos, x) in enumerate(al, 1) if x == alphabet.lower()][0]}'


def position(alphabet):
	index_alphabet = 'abcdefghijklmnopqrstuvwxyz'
	return 'Position of alphabet: ' + str(index_alphabet.index(alphabet) + 1)


def position(alphabet):
	alpha = '1abcdefghijklmnopqrstuvwxyz'
	return 'Position of alphabet: ' + str(alpha.find(alphabet))


def position(alphabet):
	letters = [0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	return 'Position of alphabet: {}'.format(letters.index(alphabet.lower()))


position = lambda alphabet: f'Position of alphabet: {ord(alphabet) - 96}'


def position(letter):
	print(letter)
	alph = 'abcdefghijklmnopqrstuvwxyz'
	for (i, elem) in enumerate(alph):
		if elem == letter:
			return f'Position of alphabet: {i + 1}'


def position(alphabet):
	r = ord(alphabet) - 96
	return 'Position of alphabet: {}'.format(r)
	pass


position = lambda s: f"Position of alphabet: {__import__('string').ascii_letters.index(s) + 1}"


import string

def position(alphabet):
	dict_alphabet = dict(zip(string.ascii_lowercase, range(1, 27)))
	return f'Position of alphabet: {dict_alphabet[alphabet]}'


def position(alphabet):
	a = ' abcdefghijklmnopqrstuvwxyz'
	return 'Position of alphabet: ' + str(a.find(alphabet))


def position(a):
	return 'Position of alphabet: {}'.format(ord(a) - ord('a') + 1)


def position(letter: str) -> str:
	return f'Position of alphabet: {ord(letter) - 96}'


def position(alphabet):
	abc = 'abcdefghijklmnopqrstuvwxyz'
	return f'Position of alphabet: {abc.index(alphabet) + 1}'


def position(alphabet):
	pos = ord(alphabet) - ord('a') + 1
	return f'Position of alphabet: {pos}'


def position(alphabet):
	return 'Position of alphabet: %i' % (ord(alphabet.lower()) - 96)


def position(alphabet):
	txt = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
	x = txt.lower().find(alphabet) + 1
	solution = 'Position of alphabet: {}'
	return solution.format(x)


from string import ascii_lowercase as alphabet

def position(letter):
	return 'Position of alphabet: {}'.format(alphabet.find(letter) + 1)


def position(a):
	g = 'abcdefghijklmnopqrstuvwxyz'
	return 'Position of alphabet: ' + str(g.find(a) + 1)


import string

def position(alphabet):
	al = list(enumerate(list(string.ascii_lowercase), 1))
	d = {}
	for e in al:
		x = {e[1]: e[0]}
		d.update(x)
	return 'Position of alphabet: ' + str(d[alphabet])


def position(alphabet):
	return 'Position of alphabet: {0}'.format('abcdefghijklmnopqrstuvwxyz'.index(alphabet) + 1)


def position(alphabet):
	value = ord(alphabet) - 96
	print(value)
	return 'Position of alphabet: ' + str(value)


def position(alphabet):
	letters = '0abcdefghijklmnopqrstuvwxyz'
	return 'Position of alphabet: ' + str(letters.index(alphabet))


def position(l):
	return 'Position of alphabet: ' + str(ord(l.lower()) - 96)


def position(alphabet):
	dictionary = {chr(96 + i): i for i in range(1, 27)}
	return 'Position of alphabet: ' + str(dictionary[alphabet])


position = lambda a: 'Position of alphabet: ' + str('0abcdefghijklmnopqrstuvwxyz'.index(a))


import string

def position(a):
	return 'Position of alphabet: {}'.format(list(string.ascii_lowercase).index(a) + 1)


def position(letter):
	return f"Position of alphabet: {ord(letter) - ord('a') + 1}"