+ 2
Can't understand code coach Secret message
You are trying to send a secret message, and you've decided to encode it by replacing every letter in your message with its corresponding letter in a backwards version of the alphabet. What do your messages look like? Task: Create a program that replaces each letter in a message with its corresponding letter in a backwards version of the English alphabet. Input Format: A string of your message in its normal form. Output Format: A string of your message once you have encoded it (all lower case). Sample Input: Hello World Sample Output: svool dliow How is this possible??
10 Réponses
+ 5
Starting from A we count 1+6 more alphabets to reach H
Now if we move 7 letters back starting from Z we get Z,Y,X,W,V,U,T and finally S
+ 3
Why do you think its not possible..
Any points???
+ 3
"encode it by replacing every letter in your message with its corresponding letter in a backwards version of the alphabet."
Couldn't say it any clearer
+ 2
[I'm new in 2022, it's take my 3hr, but i solved it painful:] 🥱🥱
import string
txt = str(input())
txte = txt.lower()
alphab = list(string.ascii_lowercase)
#print(alphab[::-1][7])
for t in txte.split(" "):
oupt = ""
for j in t:
for i in range(0,len(alphab)):
if j == alphab[i]:
oupt+=alphab[::-1][i]
print(oupt,end=" ")
+ 2
inp = input().lower()
az = 'abcdefghijklm nopqrstuvwxyz'
enc = dict(zip(az,az[::-1]))
print (''.join([enc[i] for i in inp]))
0
Steve Sajeev
I can't understand how that result comes from string "Hello World"
0
Thanks Everyone
0
So it is only an simple encryption program only.
0
alphabet="abcdefghijklmnopqrstuvwxyz"
ms= input().lower()
coded_ms=''
for x in range(len(ms)) :
for z in range(len(alphabet)):
if alphabet[z]==ms[x]:
coded_ms+=alphabet[-z-1]
if ms[x]==' ' :
coded_ms +=' '
print (coded_ms)
0
import string
l=str(string.ascii_lowercase)
s=(input().lower()).split(" ")
li=[]
r=""
#print(abs(9))
for i in l:
li.append(i)
for j in s:
for i in j:
n=li.index(i)
r+=li[-abs(n+1)]
r+=" "
print(r)