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

added 11 characters in body
Source Link
Mukundan314
  • 13.7k
  • 1
  • 19
  • 62

Python 2, (削除) 38 (削除ここまで) (削除) 37 (削除ここまで) 36(削除) 36 (削除ここまで) 34 bytes

-1 bytes thanks to Jo King

s='print"s=%r;exec s"%(s+s)#';execs;"%s+s';exec s

Try it online! Try it online!


Python 3.8 (pre-release), (削除) 39 (削除ここまで) 38(削除) 38 (削除ここまで) 36 bytes

exec(s:='print("exec(s:=%r)"%(s+s);"%s+s)#'')

Try it online! Try it online!

Python 2, (削除) 38 (削除ここまで) (削除) 37 (削除ここまで) 36 bytes

-1 bytes thanks to Jo King

s='print"s=%r;exec s"%(s+s)#';exec s

Try it online!


Python 3.8 (pre-release), (削除) 39 (削除ここまで) 38 bytes

exec(s:='print("exec(s:=%r)"%(s+s))#')

Try it online!

Python 2, (削除) 38 (削除ここまで) (削除) 37 (削除ここまで) (削除) 36 (削除ここまで) 34 bytes

-1 bytes thanks to Jo King

s='print"s=%r;exec s;"%s+s';exec s

Try it online!


Python 3.8 (pre-release), (削除) 39 (削除ここまで) (削除) 38 (削除ここまで) 36 bytes

exec(s:='print("exec(s:=%r);"%s+s)')

Try it online!

added 15 characters in body
Source Link
Mukundan314
  • 13.7k
  • 1
  • 19
  • 62

Python 2, (削除) 38 (削除ここまで) 37(削除) 37 (削除ここまで) 36 bytes

-1 bytes thanks to Jo King

s='print"s=%r;exec s"%(s+"#"s+s)';exec#';exec s

Try it online! Try it online!


Python 3.8 (pre-release), 39(削除) 39 (削除ここまで) 38 bytes

exec(s:='print("exec(s:=%r)"%(s+"#"s+s))'#')

Try it online! Try it online!

Python 2, (削除) 38 (削除ここまで) 37 bytes

-1 bytes thanks to Jo King

s='print"s=%r;exec s"%(s+"#")';exec s

Try it online!


Python 3.8 (pre-release), 39 bytes

exec(s:='print("exec(s:=%r)"%(s+"#"))')

Try it online!

Python 2, (削除) 38 (削除ここまで) (削除) 37 (削除ここまで) 36 bytes

-1 bytes thanks to Jo King

s='print"s=%r;exec s"%(s+s)#';exec s

Try it online!


Python 3.8 (pre-release), (削除) 39 (削除ここまで) 38 bytes

exec(s:='print("exec(s:=%r)"%(s+s))#')

Try it online!

added 37 characters in body
Source Link
Mukundan314
  • 13.7k
  • 1
  • 19
  • 62

Python 2, 38(削除) 38 (削除ここまで) 37 bytes

-1 bytes thanks to Jo King

s='print "s=%r;execs='print"s=%r;exec s"%(s+"#")';exec s

Try it online! Try it online!


Python 3.8 (pre-release), 39 bytes

exec(s:='print("exec(s:=%r)"%(s+"#"))')

Try it online!

Python 2, 38 bytes

s='print "s=%r;exec s"%(s+"#")';exec s

Try it online!


Python 3.8 (pre-release), 39 bytes

exec(s:='print("exec(s:=%r)"%(s+"#"))')

Try it online!

Python 2, (削除) 38 (削除ここまで) 37 bytes

-1 bytes thanks to Jo King

s='print"s=%r;exec s"%(s+"#")';exec s

Try it online!


Python 3.8 (pre-release), 39 bytes

exec(s:='print("exec(s:=%r)"%(s+"#"))')

Try it online!

Source Link
Mukundan314
  • 13.7k
  • 1
  • 19
  • 62
Loading

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