Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Password output
#1
I very new to python and this post may not be allowed.

I'm looking to be able to input the password in a field and get a result like the below.
input: Hvm$?G5

And get an output of:
H HOTEL, V victor, $ dollar sign, ? question mark, G GIRL, 5 number 5.

Again I'm very new at this, should I start with creating a variable or string with every keyboard combination this seems like I would have a lot of variables this way. Where should I start with this?

Thanks in advance.
Reply
#2
A dictionary looks like a good candidate
D = {'H': 'HOTEL', 'V': 'victor'}
Reply
#3
to expand on Griboullis answer:
there are plenty of spelling alphabets. It's a good start to look at these
there is even a python package
https://pypi.org/project/phonetic-alphabet/
also if you google it:https://www.google.com/search?q=python+spelling+alphabet
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#4
I was working on this today I created this but ran into trouble with the colon, semicolon, double quote, single quote. I still need to create input/output box.

passwordConversion = {
    "A": "ALPHA",
    "a": "alpha",
    "B": "BRAVO",
    "b": "bravo",
    "C": "CHARLIE",
    "c": "charlie",
    "D": "DELTA",
    "d": "delta",
    "E": "ECHO",
    "e": "echo",
    "F": "FOXTROT",
    "f": "foxtrot",
    "G": "GOLF",
    "g": "golf",
    "H": "HOTEL",
    "h": "hotel",
    "I": "INDIA",
    "i": "india",
    "J": "JULIET",
    "j": "juliet",
    "K": "KILO",
    "k": "kilo",
    "L": "LIMA",
    "l": "lima",
    "M": "MIKE",
    "m": "mike",
    "N": "NOVEMBER",
    "n": "november",
    "O": "OSCAR",
    "o": "oscar",
    "P": "PAPA",
    "p": "papa",
    "Q": "QUEBEC",
    "q": "quebec",
    "R": "ROMEO",
    "r": "romeo",
    "S": "SIERRA",
    "s": "sierra",
    "T": "TANGO",
    "t": "tango",
    "U": "UNIFORM",
    "u": "uniform",
    "V": "VICTOR",
    "v": "victor",
    "W": "WHISKEY",
    "w": "whiskey",
    "X": "XRAY",
    "x": "xray",
    "Y": "YANKEE",
    "y": "yankee",
    "Z": "ZULU",
    "z": "zulu",
    "1": "Number 1",
    "2": "Number 2",
    "3": "Number 3",
    "4": "Number 4",
    "5": "Number 5",
    "6": "Number 6",
    "7": "Number 7",
    "8": "Number 8",
    "9": "Number 9",
    "0": "Number 0",
    "~": "tilde",
    "`": "back Quote",
    "!": "exclamation point",
    "@": "at sign",
    "#": "number sign",
    "$": "dollar sign",
    "%": "percent sign",
    "^": "caret",
    "&": "ampersand",
    "*": "asterisk",
    "(": "left parentheses",
    ")": "right parentheses",
    "_": "underscore",
    "-": "hyphen",
    "+": "plus sign",
    "=": "equals sign",
    "[": "left square bracket",
    "]": "right square bracket",
    "{": "left curly bracket",
    "}": "right curly bracket",
    "\": "backslash",
    "/": "forwardslash",
    "|": "pipe",
    "<": "less than sign",
    ">": "greater than sign",
    ",": "comma",
    ".": "peorid",
    "?": "question mark",
    ":": "colon"
    ";": "semicolon"
    "": "double quote"
    "": "single quote"
}

print(passwordConversion)
Reply
#5
The problem isn't with the letters, it's that you have left out the commas separating the elements starting with the colon.

For quotes, use the other type. So a single quote would look like "'" and a double quote would be '"'.
Reply
#6
Similarly, "\" should be "\\"
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Random Password Generator with Weird Output. Why? Selenestica 2 2,543 Sep-11-2019, 04:36 AM
Last Post: Selenestica

Forum Jump:

User Panel Messages

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