Skip to main content
added 29 characters in body
Source Link
Karl Napf
  • 4.4k
  • 13
  • 31

Python 2, 78 70 68 6464 63 bytes

Actually basing on the idea of Destructible Watermelon makes it even smaller (using input is even better)(filling the string backward saves 4 bytes)(no () at while):

n,s=input(),''
l=len(`n`)
while( n):s=`n`.zfill(l)+s;n-=l
print s

Here is the old 70 byte approach (Saving 8 bytes by using backquotes instead of str and dropping the square brackets around generator thanks to Dennis):

def f(n):l=len(`n`);print"".join(`x`.zfill(l)for x in range(l,n+l,l))

Python 2, 78 70 68 64 bytes

Actually basing on the idea of Destructible Watermelon makes it even smaller (using input is even better)(filling the string backward saves 4 bytes):

n,s=input(),''
l=len(`n`)
while(n):s=`n`.zfill(l)+s;n-=l
print s

Here is the old 70 byte approach (Saving 8 bytes by using backquotes instead of str and dropping the square brackets around generator thanks to Dennis):

def f(n):l=len(`n`);print"".join(`x`.zfill(l)for x in range(l,n+l,l))

Python 2, 78 70 68 64 63 bytes

Actually basing on the idea of Destructible Watermelon makes it even smaller (using input is even better)(filling the string backward saves 4 bytes)(no () at while):

n,s=input(),''
l=len(`n`)
while n:s=`n`.zfill(l)+s;n-=l
print s

Here is the old 70 byte approach (Saving 8 bytes by using backquotes instead of str and dropping the square brackets around generator thanks to Dennis):

def f(n):l=len(`n`);print"".join(`x`.zfill(l)for x in range(l,n+l,l))
added 49 characters in body
Source Link
Karl Napf
  • 4.4k
  • 13
  • 31

Python 2, 78 70 6868 64 bytes

Actually basing on the idea of Destructible Watermelon makes it even smaller (using input is even better)(filling the string backward saves 4 bytes):

n,s=input(),''
i=l=lenl=len(`n`)
while(i<=nn):s+=`i`s=`n`.zfill(l);i+=l+s;n-=l
print s

Here is the old 70 byte approach (Saving 8 bytes by using backquotes instead of str and dropping the square brackets around generator thanks to Dennis):

def f(n):l=len(`n`);print"".join(`x`.zfill(l)for x in range(l,n+l,l))

Python 2, 78 70 68 bytes

Actually basing on the idea of Destructible Watermelon makes it even smaller (using input is even better):

n,s=input(),''
i=l=len(`n`)
while(i<=n):s+=`i`.zfill(l);i+=l
print s

Here is the old 70 byte approach (Saving 8 bytes by using backquotes instead of str and dropping the square brackets around generator thanks to Dennis):

def f(n):l=len(`n`);print"".join(`x`.zfill(l)for x in range(l,n+l,l))

Python 2, 78 70 68 64 bytes

Actually basing on the idea of Destructible Watermelon makes it even smaller (using input is even better)(filling the string backward saves 4 bytes):

n,s=input(),''
l=len(`n`)
while(n):s=`n`.zfill(l)+s;n-=l
print s

Here is the old 70 byte approach (Saving 8 bytes by using backquotes instead of str and dropping the square brackets around generator thanks to Dennis):

def f(n):l=len(`n`);print"".join(`x`.zfill(l)for x in range(l,n+l,l))
deleted 10 characters in body
Source Link
Karl Napf
  • 4.4k
  • 13
  • 31

Python 2, 78 70 66 6568 bytes

Actually basing on the idea of Destructible Watermelon makes it even smaller (using input is even better):

n,s=input(),''
i=l=len(`n`)
while(i<=n):s+=`i`.zfill(l);i+=l
print s

Here is the old 70 byte approach (Saving 8 bytes by using backquotes instead of str and dropping the square brackets around generator thanks to Dennis):

def f(n):l=len(`n`);print"".join(`x`.zfill(l)for x in range(l,n+l,l))

Python 2, 78 70 66 65 bytes

Actually basing on the idea of Destructible Watermelon makes it even smaller (using input is even better):

n,s=input(),''
i=l=len(`n`)
while(i<=n):s+=`i`.zfill(l);i+=l
print s

Here is the old 70 byte approach (Saving 8 bytes by using backquotes instead of str and dropping the square brackets around generator thanks to Dennis):

def f(n):l=len(`n`);print"".join(`x`.zfill(l)for x in range(l,n+l,l))

Python 2, 78 70 68 bytes

Actually basing on the idea of Destructible Watermelon makes it even smaller (using input is even better):

n,s=input(),''
i=l=len(`n`)
while(i<=n):s+=`i`.zfill(l);i+=l
print s

Here is the old 70 byte approach (Saving 8 bytes by using backquotes instead of str and dropping the square brackets around generator thanks to Dennis):

def f(n):l=len(`n`);print"".join(`x`.zfill(l)for x in range(l,n+l,l))
added 38 characters in body
Source Link
Karl Napf
  • 4.4k
  • 13
  • 31
Loading
added 216 characters in body
Source Link
Karl Napf
  • 4.4k
  • 13
  • 31
Loading
added 129 characters in body
Source Link
Karl Napf
  • 4.4k
  • 13
  • 31
Loading
added 2 characters in body
Source Link
Karl Napf
  • 4.4k
  • 13
  • 31
Loading
Source Link
Karl Napf
  • 4.4k
  • 13
  • 31
Loading