Skip to main content
Commonmark migration
Source Link

#Python 3 - 55#

Python 3 - 55

print(open(__file__).read())
f=lambda:print('f()')
f()

This could be made shorter by replacing __ file__ with a single character filename and saving the file as that, but I felt this answer was more in the spirit of the question. After one iteration it outputs:

print(open(__file__).read())
f=lambda:print('f()')
f()
f()

#Python 3 - 55#

print(open(__file__).read())
f=lambda:print('f()')
f()

This could be made shorter by replacing __ file__ with a single character filename and saving the file as that, but I felt this answer was more in the spirit of the question. After one iteration it outputs:

print(open(__file__).read())
f=lambda:print('f()')
f()
f()

Python 3 - 55

print(open(__file__).read())
f=lambda:print('f()')
f()

This could be made shorter by replacing __ file__ with a single character filename and saving the file as that, but I felt this answer was more in the spirit of the question. After one iteration it outputs:

print(open(__file__).read())
f=lambda:print('f()')
f()
f()
Source Link

#Python 3 - 55#

print(open(__file__).read())
f=lambda:print('f()')
f()

This could be made shorter by replacing __ file__ with a single character filename and saving the file as that, but I felt this answer was more in the spirit of the question. After one iteration it outputs:

print(open(__file__).read())
f=lambda:print('f()')
f()
f()