Quick actions

cmd+k|ctrl+k

Navigation

Languages

Braille

Snippet info

Language

Python

Visibility

public

Author

soham57

Created

2022-03-15T17:15:48.598028Z

Updated

2022-03-15T17:18:47.152652Z

def solution(message):
    # Your code here
    cipherKey={
        "a":"100000",
        "b":"110000",
        "c":"100100",
        "d":"100110",
        "e":"100010",
        "f":"110100",
        "g":"110110",
        "h":"110010",
        "i":"010100",
        "j":"010110",
        "k":"101000",
        "l":"111000",
        "m":"101100",
        "n":"101110",
        "o":"101010",
        "p":"111100",
        "q":"111110",
        "r":"111010",
        "s":"011100",
        "t":"011110",
        "u":"101001",
        "v":"111001",
        "w":"010111",
        "x":"101101",
        "y":"101111",
        "z":"101011"
        }
    brailleTranslation=""
    
    for character in message:
        if character == ' ':
            brailleTranslation+='000000'
            
        else:
            
            if character.isupper():
                brailleTranslation+='000001'
            brailleTranslation+=cipherKey[character.lower()]
    
    return brailleTranslation    
INFO