Python jumbled word

The below message is encrypted with a programming language and its datatype. The word is arranged in a serial order combining the two words. You have to isolate the letters and form a word in given sample output.If the string length is different ,you have to add a ‘*’ to replace the empty space and remove the symbol. Write a python code to identify and print the results.

The message is ‘ptyutphloen’

Sample Input:

ptyutphloen

Sample Output:

Python,tuple

Solution:

word = 'ptyutphloen'
''.join(word[0::2].rstrip('*') + ',' + word[1::2].rstrip('*'))

Published by kishan

You will know about me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: