+ 4
Could this code have fewer lines of code? Like instructions of functional programming
21 Antworten
+ 5
Okay I give up, here is my 65 character code ☺️:
https://code.sololearn.com/ctZ8PeXzMZKH/?ref=app
+ 6
RUSIRU
import string
a = input()
l = string.ascii_lowercase+' '
for i in a.lower():
n = l.index(i)
print(l[25 - n], end='')
👇
import string
l = string.ascii_lowercase+' '
for i in input().lower():
print(l[25 - l.index(i)], end='')
👇
import string;l=string.ascii_lowercase+' '
for i in input().lower():print(l[25-l.index(i)],end='')
👇
In one line, 99 characters 👏👏👏👍☺️:
import string;l=string.ascii_lowercase+' ';print(''.join(l[25-l.index(i)]for i in input().lower()))
+ 4
IN TWO LINES
1)a=' abcdefghijklmnopqrstuvwxyz '
2)print(''.join([a[-a.index(i)-1] for i in input().lower()]))
+ 4
+ 4
😄😄 Vasiliy you have hooked me into a competition.
Let my try another entry. Can you make it shorter than 83 characters? 😏
https://code.sololearn.com/c13uSM1hmQxc/?ref=app
+ 4
Vasiliy I still count 83. If you prefer 81, then count this please:
https://code.sololearn.com/c72U1VozJNTf/?ref=app
+ 3
Frank Castro
alphabet='abcdefghijklm nopqrstuvwxyz'
backwardAlphabet=alphabet[::-1]
inputStr=input()
result=''
for letter in inputStr.lower():
indexLetter=alphabet.index(letter)
result+=backwardAlphabet[indexLetter]
print(result)
👇
a='abcdefghijklm nopqrstuvwxyz'
backwardAlphabet=a[::-1]
result=''
for l in input().lower():
i=a.index(l)
result+=backwardAlphabet[i]
print(result)
👇
a='abcdefghijklm nopqrstuvwxyz'
result=''
for l in input().lower():
result+=a[::-1][a.index(l)]
print(result)
👇
In one line, 91 characters ☺️:
a='abcdefghijklm nopqrstuvwxyz';print(''.join(a[::-1][a.index(l)]for l in input().lower()))
+ 3
Prabhas Koya in one line, 88 characters
👏👏👏👏👏👍☺️:
a='abcdefghijklm nopqrstuvwxyz';print(''.join(a[-a.index(i)-1]for i in input().lower()))
+ 1
Try this :)
import string
a = input()
l = string.ascii_lowercase
u = string.ascii_uppercase
n = 0
for i in a:
if i in l:
n = l.index(i)
print(l[25 - n], end="")
elif i in u:
n = u.index(i)
print(l[25 - n], end="")
elif i == " ":
print(i, end="")
+ 1
Have a look at it:
https://www.sololearn.com/Discuss/2731201/secret-message
+ 1
Brian 95 characters👏👏👏👍☺️
+ 1
Brian, not 83, 81 characters ☺️
👏👏👏👏👏👍
+ 1
😳Brian, 78 char!!! ☺️
👏👏👏👏👏👍
+ 1
Brian, 68 char ☺️
+ 1
Vasiliy I think 68 char is impossible. 72 is the best I can do:
https://code.sololearn.com/cw26IHs68AZ7/?ref=app
+ 1
Brian, I have shortened the code to 65 characters!!! ☺️
+ 1
For some reason I am not allowed to do this, it looks like I went beyond the bounds of what is permitted 🤣🤣🤣
And it all started with this discussion.
Now I can’t even share the html code in discussions, I asked a question about this, but so far there’s silence.
+ 1
Wow Vasiliy using conditions in a new way.
+ 1
Prabhas Koya, I would not say that this is something new, just rare ☺️
+ 1
Vasiliy bravo!! 🤩👏👏👏👏👏🤝