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 384 characters in body
Source Link
Mukundan314
  • 13.7k
  • 1
  • 19
  • 62

Python 3.8 (pre-release), (削除) 65 (削除ここまで) (削除) 61 (削除ここまで) 55 bytes

a=2
exec(s:='print(end="a=2\\nexec(s:=%r)#"%s*a);a=1')#

Try it online!


Python 2 , 60 bytes

s='try:n\nexcept:n="s=%r;exec s"%s;print n\nprint n';exec s

Try it online!

Python 3.8 (pre-release), (削除) 65 (削除ここまで) (削除) 61 (削除ここまで) 55 bytes

a=2
exec(s:='print(end="a=2\\nexec(s:=%r)#"%s*a);a=1')#

Try it online!

Python 3.8 (pre-release), (削除) 65 (削除ここまで) (削除) 61 (削除ここまで) 55 bytes

a=2
exec(s:='print(end="a=2\\nexec(s:=%r)#"%s*a);a=1')#

Try it online!


Python 2 , 60 bytes

s='try:n\nexcept:n="s=%r;exec s"%s;print n\nprint n';exec s

Try it online!

deleted 16 characters in body
Source Link
Mukundan314
  • 13.7k
  • 1
  • 19
  • 62

Python 3.8 (pre-release), (削除) 65 (削除ここまで) 61(削除) 61 (削除ここまで) 55 bytes

a=2
exec(s:='try:n\nexcept:print='print(n:="execend="a=2\\nexec(s:=%r)"%s)\nprint(n#"%s*a)';a=1')#

Try it online! Try it online!

Python 3.8 (pre-release), (削除) 65 (削除ここまで) 61 bytes

exec(s:='try:n\nexcept:print(n:="exec(s:=%r)"%s)\nprint(n)')

Try it online!

Python 3.8 (pre-release), (削除) 65 (削除ここまで) (削除) 61 (削除ここまで) 55 bytes

a=2
exec(s:='print(end="a=2\\nexec(s:=%r)#"%s*a);a=1')#

Try it online!

edited body
Source Link
Mukundan314
  • 13.7k
  • 1
  • 19
  • 62

Python 3.8 (pre-release), 65(削除) 65 (削除ここまで) 61 bytes

exec(s:='print='try:n\nexcept:print(pn:="exec(s:=%r)"%s)\ntry:n\nexcept:print\nprint(pn);n=1'')

Try it online! Try it online!

Python 3.8 (pre-release), 65 bytes

exec(s:='print(p:="exec(s:=%r)"%s)\ntry:n\nexcept:print(p);n=1')

Try it online!

Python 3.8 (pre-release), (削除) 65 (削除ここまで) 61 bytes

exec(s:='try:n\nexcept:print(n:="exec(s:=%r)"%s)\nprint(n)')

Try it online!

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

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