Skip to main content
Commonmark migration
Source Link

#Python 2, 64 63 bytes

Python 2, 64 63 bytes

Anonymous function with arguments n and k, returns the list to output.

lambda n,k:[[i,'Shaggy'][i%k<1or`k`in`i`]for i in range(1,n+1)]

Alternatively, a function which prints to STDOUT for the same bytecount:

def f(n,k,i=1):exec"print[i,'Shaggy'][i%k<1or`k`in`i`];i+=1;"*n

#Python 2, 64 63 bytes

Anonymous function with arguments n and k, returns the list to output.

lambda n,k:[[i,'Shaggy'][i%k<1or`k`in`i`]for i in range(1,n+1)]

Alternatively, a function which prints to STDOUT for the same bytecount:

def f(n,k,i=1):exec"print[i,'Shaggy'][i%k<1or`k`in`i`];i+=1;"*n

Python 2, 64 63 bytes

Anonymous function with arguments n and k, returns the list to output.

lambda n,k:[[i,'Shaggy'][i%k<1or`k`in`i`]for i in range(1,n+1)]

Alternatively, a function which prints to STDOUT for the same bytecount:

def f(n,k,i=1):exec"print[i,'Shaggy'][i%k<1or`k`in`i`];i+=1;"*n
Rollback to Revision 3
Source Link
FlipTack
  • 14.7k
  • 3
  • 54
  • 101

#Python 2, 64 63 6263 bytes

Anonymous function with arguments n and k, returns the list to output.

lambda n,k:[[i,'Shaggy'][i%k<1or`k`in`i`]for i in range(1,n+1)]

Alternatively, a function which prints to STDOUT for the same bytecount:

def f(n,k,i=1):exec"print[i,'Shaggy'][`k`[:i%k]in`i`];i+=1;"*n'Shaggy'][i%k<1or`k`in`i`];i+=1;"*n

#Python 2, 64 63 62 bytes

def f(n,k,i=1):exec"print[i,'Shaggy'][`k`[:i%k]in`i`];i+=1;"*n

#Python 2, 64 63 bytes

Anonymous function with arguments n and k, returns the list to output.

lambda n,k:[[i,'Shaggy'][i%k<1or`k`in`i`]for i in range(1,n+1)]

Alternatively, a function which prints to STDOUT for the same bytecount:

def f(n,k,i=1):exec"print[i,'Shaggy'][i%k<1or`k`in`i`];i+=1;"*n
deleted 246 characters in body
Source Link
FlipTack
  • 14.7k
  • 3
  • 54
  • 101

#Python 2, 64 63 bytes

Anonymous function with arguments n and k, returns the list to output.

lambda n,k:[[i,'Shaggy'][i%k<1or`k`in`i`]for i in range(1,n+1)]

Alternatively, a function which prints to STDOUT for the same bytecount:63 62 bytes

def f(n,k,i=1):exec"print[i,'Shaggy'][i%k<1or`k`in`i`];i+=1;"*n'Shaggy'][`k`[:i%k]in`i`];i+=1;"*n

#Python 2, 64 63 bytes

Anonymous function with arguments n and k, returns the list to output.

lambda n,k:[[i,'Shaggy'][i%k<1or`k`in`i`]for i in range(1,n+1)]

Alternatively, a function which prints to STDOUT for the same bytecount:

def f(n,k,i=1):exec"print[i,'Shaggy'][i%k<1or`k`in`i`];i+=1;"*n

#Python 2, 64 63 62 bytes

def f(n,k,i=1):exec"print[i,'Shaggy'][`k`[:i%k]in`i`];i+=1;"*n
added 74 characters in body
Source Link
FlipTack
  • 14.7k
  • 3
  • 54
  • 101
Loading
added 144 characters in body
Source Link
FlipTack
  • 14.7k
  • 3
  • 54
  • 101
Loading
Post Undeleted by FlipTack
Post Deleted by FlipTack
Source Link
FlipTack
  • 14.7k
  • 3
  • 54
  • 101
Loading