Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#Python 3, (削除) 195 (削除ここまで)(削除) 169 (削除ここまで)(削除) 168 (削除ここまで) 166 bytes

Python 3, (削除) 195 (削除ここまで)(削除) 169 (削除ここまで)(削除) 168 (削除ここまで) 166 bytes

Thanks to @TrangOul for -2 bytes!

How didn't I see that I could have golfed that down before?

x=__import__('string').ascii_letters;y,z=x[26:],x[:26];a,b=y[::-1],z[::-1];print(''.join(b[z.index(i)]if i in b else a[y.index(i)]if i in a else i for i in input()))

(sorta) ungolfed:

x = __import__('string').ascii_letters;
y, z = x[26: ], x[: 26];
a, b = y[::-1], z[::-1];
print(''.join(b[z.index(i)]
 if i in b
 else a[y.index(i)]
 if i in a
 else i
 for i in input()
))

Try it on Ideone!

#Python 3, (削除) 195 (削除ここまで)(削除) 169 (削除ここまで)(削除) 168 (削除ここまで) 166 bytes

Thanks to @TrangOul for -2 bytes!

How didn't I see that I could have golfed that down before?

x=__import__('string').ascii_letters;y,z=x[26:],x[:26];a,b=y[::-1],z[::-1];print(''.join(b[z.index(i)]if i in b else a[y.index(i)]if i in a else i for i in input()))

(sorta) ungolfed:

x = __import__('string').ascii_letters;
y, z = x[26: ], x[: 26];
a, b = y[::-1], z[::-1];
print(''.join(b[z.index(i)]
 if i in b
 else a[y.index(i)]
 if i in a
 else i
 for i in input()
))

Try it on Ideone!

Python 3, (削除) 195 (削除ここまで)(削除) 169 (削除ここまで)(削除) 168 (削除ここまで) 166 bytes

Thanks to @TrangOul for -2 bytes!

How didn't I see that I could have golfed that down before?

x=__import__('string').ascii_letters;y,z=x[26:],x[:26];a,b=y[::-1],z[::-1];print(''.join(b[z.index(i)]if i in b else a[y.index(i)]if i in a else i for i in input()))

(sorta) ungolfed:

x = __import__('string').ascii_letters;
y, z = x[26: ], x[: 26];
a, b = y[::-1], z[::-1];
print(''.join(b[z.index(i)]
 if i in b
 else a[y.index(i)]
 if i in a
 else i
 for i in input()
))

Try it on Ideone!

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

#Python 3, (削除) 195 (削除ここまで) (削除) 169 (削除ここまで) (削除) 168 (削除ここまで) 166 bytes

Thanks to @TrangOul @TrangOul for -2 bytes!

How didn't I see that I could have golfed that down before?

x=__import__('string').ascii_letters;y,z=x[26:],x[:26];a,b=y[::-1],z[::-1];print(''.join(b[z.index(i)]if i in b else a[y.index(i)]if i in a else i for i in input()))

(sorta) ungolfed:

x = __import__('string').ascii_letters;
y, z = x[26: ], x[: 26];
a, b = y[::-1], z[::-1];
print(''.join(b[z.index(i)]
 if i in b
 else a[y.index(i)]
 if i in a
 else i
 for i in input()
))

Try it on Ideone!

#Python 3, (削除) 195 (削除ここまで) (削除) 169 (削除ここまで) (削除) 168 (削除ここまで) 166 bytes

Thanks to @TrangOul for -2 bytes!

How didn't I see that I could have golfed that down before?

x=__import__('string').ascii_letters;y,z=x[26:],x[:26];a,b=y[::-1],z[::-1];print(''.join(b[z.index(i)]if i in b else a[y.index(i)]if i in a else i for i in input()))

(sorta) ungolfed:

x = __import__('string').ascii_letters;
y, z = x[26: ], x[: 26];
a, b = y[::-1], z[::-1];
print(''.join(b[z.index(i)]
 if i in b
 else a[y.index(i)]
 if i in a
 else i
 for i in input()
))

Try it on Ideone!

#Python 3, (削除) 195 (削除ここまで) (削除) 169 (削除ここまで) (削除) 168 (削除ここまで) 166 bytes

Thanks to @TrangOul for -2 bytes!

How didn't I see that I could have golfed that down before?

x=__import__('string').ascii_letters;y,z=x[26:],x[:26];a,b=y[::-1],z[::-1];print(''.join(b[z.index(i)]if i in b else a[y.index(i)]if i in a else i for i in input()))

(sorta) ungolfed:

x = __import__('string').ascii_letters;
y, z = x[26: ], x[: 26];
a, b = y[::-1], z[::-1];
print(''.join(b[z.index(i)]
 if i in b
 else a[y.index(i)]
 if i in a
 else i
 for i in input()
))

Try it on Ideone!

added 152 characters in body
Source Link
cat
  • 6.1k
  • 2
  • 27
  • 45

#Python 3, (削除) 195 (削除ここまで) (削除) 169 (削除ここまで) 168(削除) 168 (削除ここまで) 166 bytes

Thanks to @TrangOul for -2 bytes!

How didn't I see that I could have golfed that down before?

x=__import__('string').ascii_letters;y,z=x[26:],x[:26];a,b=y[::-1],z[::-1];print(''.join([b[zb[z.index(i)]if i in b else a[y.index(i)]if i in a else i for i in input()]))

(sorta) ungolfed:

x = __import__('string').ascii_letters;
y, z = x[26: ], x[: 26];
a, b = y[::-1], z[::-1];
print(''.join([b[zb[z.index(i)]
 if i in b
 else a[y.index(i)]
 if i in a
 else i
 for i in input()
]))

Try it on Ideone!

#Python 3, (削除) 195 (削除ここまで) (削除) 169 (削除ここまで) 168 bytes

How didn't I see that I could have golfed that down before?

x=__import__('string').ascii_letters;y,z=x[26:],x[:26];a,b=y[::-1],z[::-1];print(''.join([b[z.index(i)]if i in b else a[y.index(i)]if i in a else i for i in input()]))

(sorta) ungolfed:

x = __import__('string').ascii_letters;
y, z = x[26: ], x[: 26];
a, b = y[::-1], z[::-1];
print(''.join([b[z.index(i)]
 if i in b
 else a[y.index(i)]
 if i in a
 else i
 for i in input()
]))

#Python 3, (削除) 195 (削除ここまで) (削除) 169 (削除ここまで) (削除) 168 (削除ここまで) 166 bytes

Thanks to @TrangOul for -2 bytes!

How didn't I see that I could have golfed that down before?

x=__import__('string').ascii_letters;y,z=x[26:],x[:26];a,b=y[::-1],z[::-1];print(''.join(b[z.index(i)]if i in b else a[y.index(i)]if i in a else i for i in input()))

(sorta) ungolfed:

x = __import__('string').ascii_letters;
y, z = x[26: ], x[: 26];
a, b = y[::-1], z[::-1];
print(''.join(b[z.index(i)]
 if i in b
 else a[y.index(i)]
 if i in a
 else i
 for i in input()
))

Try it on Ideone!

deleted 12 characters in body
Source Link
cat
  • 6.1k
  • 2
  • 27
  • 45
Loading
Source Link
cat
  • 6.1k
  • 2
  • 27
  • 45
Loading

AltStyle によって変換されたページ (->オリジナル) /