I'm attempting to write a program that will take a word entered by the user and give a concatenation of the corresponding triple quote strings.
I've looked at http://www.daniweb.com/forums/thread189881.html, but didn't quite find the piece I'm missing.
The idea is fairly simple:
User inputs a word (or numbers)
Exchanges letters for corresponding "symbols" (for lack of a better term)
Outputs concatenated symbols
Here's how I've got it set up so far:
# Create a "normal" alphabet to compare it to
base = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
FIVEHIGH = (
"""
X 0 X X
0 X 0 X
0 0 0 X
0 X 0 X
0 X 0 X
""",
"""
0 0 X X
0 X 0 X
0 0 X X
0 X 0 X
0 0 X X
""",
"""
X 0 X X
0 X 0 X
0 X X X
0 X 0 X
X 0 X X
""")
# Cut for the sake of space
### PROGRAM START ###
cypher = string.maketrans(base, FIVEHIGH)
print "Welcome to the Word Converter!\n\n"
# OTHER DEFINITIONS
word = raw_input("What word should we convert? ").upper()
# FEEDBACK
if word == "":
print "No word entered"
else:
print "Your word is",word
word.translate(cypher)
print word
raw_input("\nPress any key")
I've also toyed with dictionaries, but couldn't get them to work either. Any help would be greatly appreciated.