Skip to main content
added 22 characters in body
Source Link
pxeger
  • 24.6k
  • 4
  • 53
  • 141

Python, 3938 bytes

def f(a,x):f(a[1:print(a.index(x));f(a[1:],x)

Attempt This Online!Attempt This Online!

Finishes with an exception

-5 bytes thanks to AnttiP

-1 thanks to dingledooper

Whython, 4140 bytes

def f(a,x):f(a[1:print(a.index(x))+f(a[1:],x)?0

Attempt This Online!Attempt This Online!

No error

Python, 39 bytes

def f(a,x):print(a.index(x));f(a[1:],x)

Attempt This Online!

Finishes with an exception

-5 bytes thanks to AnttiP

Whython, 41 bytes

def f(a,x):print(a.index(x))+f(a[1:],x)?0

Attempt This Online!

No error

Python, 38 bytes

def f(a,x):f(a[1:print(a.index(x))],x)

Attempt This Online!

Finishes with an exception

-5 bytes thanks to AnttiP

-1 thanks to dingledooper

Whython, 40 bytes

def f(a,x):f(a[1:print(a.index(x))],x)?0

Attempt This Online!

No error

deleted 17 characters in body
Source Link
pxeger
  • 24.6k
  • 4
  • 53
  • 141

Python, 39 bytes

def f(a,x):print(a.index(x));f(a[1:],x)

Attempt This Online!

Finishes with an exception

-5 bytes thanks to AnttiP

Whython, 4641 bytes

def f(a,x):
 while[printprint(a.index(x))+f(a[1:],x)?0:_,*a=a

Attempt This Online!Attempt This Online!

No error

Python, 39 bytes

def f(a,x):print(a.index(x));f(a[1:],x)

Attempt This Online!

Finishes with an exception

-5 bytes thanks to AnttiP

Whython, 46 bytes

def f(a,x):
 while[print(a.index(x))]?0:_,*a=a

Attempt This Online!

No error

Python, 39 bytes

def f(a,x):print(a.index(x));f(a[1:],x)

Attempt This Online!

Finishes with an exception

-5 bytes thanks to AnttiP

Whython, 41 bytes

def f(a,x):print(a.index(x))+f(a[1:],x)?0

Attempt This Online!

No error

deleted 426 characters in body
Source Link
pxeger
  • 24.6k
  • 4
  • 53
  • 141

Python, 4439 bytes

def f(a,x):
 while[printprint(a.index(x))];f(a[1:_],*a=ax)

Attempt This Online!Attempt This Online!

Finishes with an exception. If not allowed:

Python, 49 bytes

def f(a,x):
 while x in a:yield a.index(x);_,*a=a

Attempt This Online!-5 bytes thanks to AnttiP

Whython, 46 bytes

def f(a,x):
 while[print(a.index(x))]?0:_,*a=a

Attempt This Online!

No error

Python, 44 bytes

def f(a,x):
 while[print(a.index(x))]:_,*a=a

Attempt This Online!

Finishes with an exception. If not allowed:

Python, 49 bytes

def f(a,x):
 while x in a:yield a.index(x);_,*a=a

Attempt This Online!

Whython, 46 bytes

def f(a,x):
 while[print(a.index(x))]?0:_,*a=a

Attempt This Online!

Python, 39 bytes

def f(a,x):print(a.index(x));f(a[1:],x)

Attempt This Online!

Finishes with an exception

-5 bytes thanks to AnttiP

Whython, 46 bytes

def f(a,x):
 while[print(a.index(x))]?0:_,*a=a

Attempt This Online!

No error

added 403 characters in body
Source Link
pxeger
  • 24.6k
  • 4
  • 53
  • 141
Loading
deleted 354 characters in body
Source Link
pxeger
  • 24.6k
  • 4
  • 53
  • 141
Loading
Source Link
pxeger
  • 24.6k
  • 4
  • 53
  • 141
Loading