Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MORSE = {
- '.-': 'A',
- '-...': 'B',
- '-.-.': 'C',
- '-..': 'D',
- '.': 'E',
- '..-.': 'F',
- '--.': 'G',
- '....': 'H',
- '..': 'I',
- '.---': 'J',
- '-.-': 'K',
- '.-..': 'L',
- '--': 'M',
- '-.': 'N',
- '---': 'O',
- '.--.': 'P',
- '--.-': 'Q',
- '.-.': 'R',
- '...': 'S',
- '-': 'T',
- '..-': 'U',
- '...-': 'V',
- '.--': 'W',
- '-..-': 'X',
- '-.--': 'Y',
- '--..': 'Z'
- }
- code = input().split(' ')
- for x in range(len(code)):
- if code[x] in MORSE.keys():
- code[x] = MORSE[code[x]]
- elif code[x] == '|':
- code[x] = ' '
- print(''.join(code))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement