in general if-else condtional statements if my given input is alphabet (A-Z). so my output should represent from (0-25) ex: if my input is 'A' then it should return 0 if my input is 'B' the it should return 1 soon.... if my input is 'Z' the it should return 25.
if key=='a':
return 0
elseif key=='b':
return 1
elseif key=='c':
return 2
elseif key=='d':
return 3
elseif key=='e':
return 4
but i want to know is there any alternate way to write this code in python3? 1 or 2 lines of code can be apperciated.