+ 4

Secret message challenge

The output should be 'svool dliow' (input 'Helo world's) https://code.sololearn.com/cPyRSZl0TJqg/?ref=app

15th Feb 2020, 7:14 PM
Arthur Barbosa
Arthur Barbosa - avatar
24 Answers
+ 5
v is missing. ;)
15th Feb 2020, 7:23 PM
HonFu
HonFu - avatar
1st May 2020, 4:13 AM
Yaswanth
Yaswanth - avatar
+ 3
Here is my solution: https://code.sololearn.com/cuf2DhV4Z0Us/?ref=app I just made a list of the letters in the alphabet, made a copy of it that was reversed, combined both lists in a dictionary, and replaced each letter in the input with the opposite letter. (Better explained in the code.)
4th Aug 2020, 6:59 PM
McInventor29
McInventor29 - avatar
+ 3
My short version of the solution. https://code.sololearn.com/cdNVriqTwTYz/?ref=app
7th Apr 2021, 3:29 PM
Khidr
+ 3
Simple and efficient code👇👇✌️ : import string inp = (input()).lower() alps = string.ascii_lowercase l1 = [] for i in alps: l1.append(i) # print(l1, inp) count = [] for i in inp: try: count.append(l1.index(i)) except ValueError: count.append(" ") # print(count) str = '' for i in count: try: str += l1[25-i] except TypeError: str += " " print(str)
8th Jan 2022, 3:15 PM
Viren Shah
Viren Shah - avatar
+ 2
message=input().lower() alph="abcdefghijklmnopqrstuvwxyz" p="" for i in message: for k in range(len(alph)): if i==alph[k]: h=alph[-k-1] p+=h if i==" ": p+=" " continue print(p)
8th Oct 2021, 8:15 PM
Ayodeji Akinkuowo
Ayodeji Akinkuowo - avatar
+ 2
import string x = input().lower() abcd = string.ascii_lowercase dcba = abcd[::-1] dict = dict(zip(abcd,dcba)) res = [dict[i] if i.isalpha() else i for i in x] print("".join(res))
6th Nov 2021, 12:34 AM
Mateo González Bufi
Mateo González Bufi - avatar
+ 2
Why you write so long code? You can do this very easy:::: import string n = input().lower() b = string.ascii_lowercase for i in n: pos = b.find(i) print(b[-pos-1]) Here 6 line) I fix some bags if you can do this yourself 😉😏
17th Mar 2022, 4:35 PM
Anonymous.
+ 1
Thank you!
16th Feb 2020, 9:38 PM
Arthur Barbosa
Arthur Barbosa - avatar
+ 1
https://code.sololearn.com/cymXYyIAz23i/?ref=app
26th Jun 2020, 7:37 PM
Tanush Bhattacharya
Tanush Bhattacharya - avatar
+ 1
Here's a different ASCII solution: https://code.sololearn.com/cW38n9Sc6Ciw/?ref=app
22nd Jul 2020, 5:52 PM
Rasmus Lynge Jacobsen
Rasmus Lynge Jacobsen - avatar
+ 1
Another solution with 2 list https://code.sololearn.com/cCpv60MG4auB/#py
23rd Jul 2020, 4:47 PM
Israel Flores
Israel Flores - avatar
+ 1
alpha = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ" reversed_alpha = alpha[::-1] message = input() coded = " " for i in message : coded += reversed_alpha[alpha.index(i)] print(coded.lower())
22nd Oct 2021, 10:39 PM
Mas'ud Saleh
Mas'ud Saleh - avatar
23rd Oct 2022, 9:05 AM
Joe Davies
Joe Davies - avatar
3rd Mar 2020, 7:09 PM
Sergei
18th May 2020, 6:18 AM
IrinaKW
IrinaKW - avatar
0
This is the solution for the code coach secret message problem in my version: https://code.sololearn.com/ca17A4a25a0a/#py
11th Jan 2021, 6:17 AM
Venu Gopaal Watada
Venu Gopaal Watada - avatar
0
Thanks for the post. Helped me figure out why I was printing either each inverted letter on a separate line and not being able to combine it into a single line output. https://code.sololearn.com/cA12a16a13A1
22nd Jul 2021, 10:38 AM
Snarkly
Snarkly - avatar
2nd Oct 2021, 10:10 AM
Domilton