Skip to main content
Commonmark migration
Source Link

##Python 2, 118 111 bytes ( 113 - 2 )

Python 2, 118 111 bytes ( 113 - 2 )

a,b=0,1;print a
f=open(__file__,'r+')
s=f.read()
s=s.replace(s[4:s.find(';')],`b`+','+`a+b`)
f.seek(0)
f.write(s)

It works with any valid filename. There is not much to explain here, the code itself is very verbose.

Thanks to FlipTack for reminding me, close() is not mandatory.

##Python 2, 118 111 bytes ( 113 - 2 )

a,b=0,1;print a
f=open(__file__,'r+')
s=f.read()
s=s.replace(s[4:s.find(';')],`b`+','+`a+b`)
f.seek(0)
f.write(s)

It works with any valid filename. There is not much to explain here, the code itself is very verbose.

Thanks to FlipTack for reminding me, close() is not mandatory.

Python 2, 118 111 bytes ( 113 - 2 )

a,b=0,1;print a
f=open(__file__,'r+')
s=f.read()
s=s.replace(s[4:s.find(';')],`b`+','+`a+b`)
f.seek(0)
f.write(s)

It works with any valid filename. There is not much to explain here, the code itself is very verbose.

Thanks to FlipTack for reminding me, close() is not mandatory.

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

##Python 2, 118 111 bytes ( 113 - 2 )

a,b=0,1;print a
f=open(__file__,'r+')
s=f.read()
s=s.replace(s[4:s.find(';')],`b`+','+`a+b`)
f.seek(0)
f.write(s)

It works with any valid filename. There is not much to explain here, the code itself is very verbose.

Thanks to FlipTackFlipTack for reminding me, close() is not mandatory.

##Python 2, 118 111 bytes ( 113 - 2 )

a,b=0,1;print a
f=open(__file__,'r+')
s=f.read()
s=s.replace(s[4:s.find(';')],`b`+','+`a+b`)
f.seek(0)
f.write(s)

It works with any valid filename. There is not much to explain here, the code itself is very verbose.

Thanks to FlipTack for reminding me, close() is not mandatory.

##Python 2, 118 111 bytes ( 113 - 2 )

a,b=0,1;print a
f=open(__file__,'r+')
s=f.read()
s=s.replace(s[4:s.find(';')],`b`+','+`a+b`)
f.seek(0)
f.write(s)

It works with any valid filename. There is not much to explain here, the code itself is very verbose.

Thanks to FlipTack for reminding me, close() is not mandatory.

added 168 characters in body
Source Link

##Python 2, 118118 111 bytes (120 113 - 2  )

a,b=0,1;print a
with openf=open(__file__,'r+')as f: 
s=f.read();s=s
s=s.replace(s[4:s.find(';')],`b`+','+`a+b`);f
f.seek(0);f
f.write(s)

It works with any valid filename. There is not much to explain here, the code itself is very verbose.

Thanks to FlipTack for reminding me, close() is not mandatory.

##Python 2, 118 bytes (120 - 2)

a,b=0,1;print a
with open(__file__,'r+')as f:s=f.read();s=s.replace(s[4:s.find(';')],`b`+','+`a+b`);f.seek(0);f.write(s)

It works with any valid filename. There is not much to explain here, the code itself is very verbose.

##Python 2, 118 111 bytes ( 113 - 2  )

a,b=0,1;print a
f=open(__file__,'r+') 
s=f.read()
s=s.replace(s[4:s.find(';')],`b`+','+`a+b`)
f.seek(0)
f.write(s)

It works with any valid filename. There is not much to explain here, the code itself is very verbose.

Thanks to FlipTack for reminding me, close() is not mandatory.

unnecessary `also`.
Source Link
Loading
Source Link
Loading