+ 4
Could this code have fewer lines of code? Like instructions of functional programming
21 odpowiedzi
+ 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!! ๐คฉ๐๐๐๐๐๐ค