The purpose of the program is to shuffle only the middle letters of each word in a sentence, leaving it still readable like this:
Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae.
def garble(sentence):
return ' '.join([word[0] + ''.join(random.sample([char for char in word[1:-1]],len(word[1:-1]))) + word[-1] if len(word) > 1 else word for word in sentence.split()])
I definitely think I have gone overboard putting it all in one line but I'm not sure where to separate it