+ 3
Hm - i have tried a couple of times, but i think it works as expected. If you input a sentence, it will be encoded and printed. May be you can give us a sample from where you think it will not run.
1st May 2020, 9:48 AM
Lothar
Lothar - avatar
+ 2
Space is a character when you encode it using it your algorithm it turns to dash
1st May 2020, 10:11 AM
Abhay
Abhay - avatar
+ 2
Yes I saw that \ as well instead of b not sure about that
1st May 2020, 10:12 AM
Abhay
Abhay - avatar
+ 2
Modified that Loop remove that ,and place this a=[chr(ord(i)-13) if ord(i)==45 else chr(ord(i)-26) if ord(i)==92 else chr(ord(i)-13) if ord(i)==59 else i for i in new_text]
1st May 2020, 10:56 AM
Abhay
Abhay - avatar
+ 1
What you mean by all sorts of weird symbols lol!it just outputs Beautiful is better than ugly with dashes
1st May 2020, 10:03 AM
Abhay
Abhay - avatar
+ 1
Remove last line and add this a=[chr(ord(i)-13) if ord(i)==45 else i for i in new_text] print("".join(a))
1st May 2020, 10:20 AM
Abhay
Abhay - avatar
0
It works for capital letters as well as for multiple words,nice code:-)
1st May 2020, 9:50 AM
Abhay
Abhay - avatar