Notes '%' operator returns the reminder after the division.
Can also be seen as returning the last bit of the number in our case.
It prints 10011 because:
fun(25)
print 25%2=1
fun(25/2=12)
print 12%2=0
fun(12/2=6)
print 6%2=0
fun(6/2=3)
print 3%2=1
fun(3/2=1)
print 1%1=1