#1
(This post was last modified: 09 June, 2022 - 07:18 AM by MrBoi47. Edited 2 times in total.)
So I coded this:
Code:
print('What would you like to translate?\n\n1.Text to Binary\n2.Binary to Text\n3.Text to Decimal\n4.Decimal to Text\n5.Text to Hexadecimal\n6.Hexadecimal to Text\n7.Text to Unicode Notation\n8.Unicode Notation to Text\n9.Text to Octal\n10.Octal to Text\n')
text=list(' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890')
binary='100000 1100001 1100010 1100011 1100100 1100101 1100110 1100111 1101000 1101001 1101010 1101011 1101100 1101101 1101110 1101111 1110000 1110001 1110010 1110011 1110100 1110101 1110110 1110111 1111000 1111001 1111010 1000001 1000010 1000011 1000100 1000101 1000110 1000111 1001000 1001001 1001010 1001011 1001100 1001101 1001110 1001111 1010000 1010001 1010010 1010011 1010100 1010101 1010110 1010111 1011000 1011001 1011010 110001 110010 110011 110100 110101 110110 110111 111000 111001 110000'.split()
decimal='32 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 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 49 50 51 52 53 54 55 56 57 48'.split()
hexadecimal='20 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 31 32 33 34 35 36 37 38 39 30'.split()
unicode='U+20 U+61 U+62 U+63 U+64 U+65 U+66 U+67 U+68 U+69 U+6A U+6B U+6C U+6D U+6E U+6F U+70 U+71 U+72 U+73 U+74 U+75 U+76 U+77 U+78 U+79 U+7A U+41 U+42 U+43 U+44 U+45 U+46 U+47 U+48 U+49 U+4A U+4B U+4C U+4D U+4E U+4F U+50 U+51 U+52 U+53 U+54 U+55 U+56 U+57 U+58 U+59 U+5A U+31 U+32 U+33 U+34 U+35 U+36 U+37 U+38 U+39 U+30'.split()
octal='40 141 142 143 144 145 146 147 150 151 152 153 154 155 156 157 160 161 162 163 164 165 166 167 170 171 172 101 102 103 104 105 106 107 110 111 112 113 114 115 116 117 120 121 122 123 124 125 126 127 130 131 132 61 62 63 64 65 66 67 70 71 60'.split()
try:
    choice=int(input(''))
    if choice>0 and choice<11:
        trword=''
        word=str(input('\nPhrase to translate: \n'))
        try:
            if choice==1:
                key=dict(zip(text, binary))
                for letter in word:
                     trword+=key[letter]+' '
            elif choice==2:
                key=dict(zip(binary,text))
                for letter in word.split():
                    trword+=key[letter]
            elif choice==3:
                key=dict(zip(text,decimal))
                for letter in word:
                    trword+=key[letter]+' '
            elif choice==4:
                key=dict(zip(decimal,text))
                for letter in word.split():
                    trword+=key[letter]
            elif choice==5:
                key=dict(zip(text,hexadecimal))
                for letter in word:
                    trword+=key[letter]+' '
            elif choice==6:
                key=dict(zip(hexadecimal,text))
                for letter in word.split():
                    trword+=key[letter]
            elif choice==7:
                key=dict(zip(text,unicode))
                for letter in word:
                    trword+=key[letter]+' '
            elif choice==8:
                key=dict(zip(unicode,text))
                for letter in word.split():
                    trword+=key[letter]
            elif choice==9:
                key=dict(zip(text,octal))
                for letter in word:
                    trword+=key[letter]+' '
            else:
                key=dict(zip(octal,text))
                for letter in word.split():
                    trword+=key[letter]
            print('\n'+trword+'\n')
        except KeyError:
            print('Not the correct type')
    else:
        print('\nNot a valid choice\n')
except:
    print('\nNot a valid choice\n')
d=input('Press enter to finish\n')

Make sure to like, or you will get banned for leeching!  Smart