Posts: 4
Threads: 2
Joined: Jun 2020
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.
Posts: 4,803
Threads: 77
Joined: Jan 2018
A dictionary looks like a good candidate
1 |
D = { 'H' : 'HOTEL' , 'V' : 'victor' }
|
Posts: 8,168
Threads: 160
Joined: Sep 2016
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
Posts: 4
Threads: 2
Joined: Jun 2020
Jun-20-2020, 10:40 PM
(This post was last modified: Jun-20-2020, 10:40 PM by swittler.)
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.
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
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)
|
Posts: 1,583
Threads: 3
Joined: Mar 2020
Jun-20-2020, 11:02 PM
(This post was last modified: Jun-20-2020, 11:02 PM by bowlofred.)
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 '"' .
Posts: 4,803
Threads: 77
Joined: Jan 2018
Similarly, "\" should be "\\"
|