Python Forum
Simple Binary Translator (Using MATH instead of MATCH))
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Binary Translator (Using MATH instead of MATCH))
#3
(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.
Reply


Messages In This Thread
RE: Simple Binary Translator (Using MATH instead of MATCH)) - by DataCorrupt - Jun-09-2020, 03:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  The LOL Translator SpeedyZapGaming 7 7,890 Apr-15-2017, 08:54 AM
Last Post: GamingAgent

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020