Jan-08-2020, 08:02 AM
If I understand correctly 'the translation' means that first character is moved to an end and 'ay' is added to all words which are longer than 1 letter.
One possibility to create translate function and then use it on all words in sentence.
One possibility to create translate function and then use it on all words in sentence.
def translate(word): if len(word) == 1: return word else: return f'{word[1:]}{word[0].lower()}ay'Then just:
>>> sentence = 'Climb a tree' >>> ' '.join([translate(word) for word in sentence.split()]) 'limbcay a reetay'This must be further developed. It will not work as expected with the punctuation at the end of sentence and there is no rules for capitalisation of words.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.