Jun-09-2020, 03:16 AM
(Jun-09-2020, 02:17 AM)Larz60+ Wrote: to find positionof letter, use:
import string alphabet = string.ascii_uppercase def get_char_pos(letter): return alphabet.index(letter.upper()) # testit note 'A' = 0: print(f"Q is at position: {get_char_pos('Q')}")you can also get the value of the character and subtract value of 'A'
I admit that I did not know that, but on a positive note, I made it all without using any imports.