Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- usr_inp = input().split()
- output = ''
- for word in usr_inp:
- if len(word) >= 3:
- for ch in word:
- ch = ord(ch)+1
- output += chr(ch)
- else:
- output += word
- output += ' '
- splited_output = output.split()
- encoded_message = ''
- for word in splited_output:
- if len(word) >= 3:
- encoded_message += word[0]
- encoded_message += str(len(word[1:-1]))
- encoded_message += word[-1]
- encoded_message += ' '
- else:
- encoded_message += word + ' '
- print(encoded_message)
Advertisement
Add Comment
Please, Sign In to add comment