How to mix two sentences to encrypt a string and decrypt the string to the original sentence in Python

1 Answer

0 votes
s = "python c java c++ php c#"
temp = "programming is a lot of fun"

s = "".join(["".join(ch) for ch in zip(s, temp)])
print(s)

original_s = s[::2]
print(original_s)


'''
run:

ppyrtohgorna mcm ijnagv ai sc +a+  lpohtp  ocf#
python c java c++ php c#

'''

 



answered Dec 2, 2017 by avibootz
edited Dec 12, 2017 by avibootz
...