def leakyPipes(n):
if (n > 0):
if (n % 4 == 0):
print("drip %d" % n)
leakyPipes(n-3)
if (n % 3 == 0):
print("drop %d" % n)
leakyPipes(12)
What is each of the % in print("drip %d" % n) supposed to do in this situation? The terminal output is giving me this:
drip 12
drop 9
drop 12
It's a formatting specifier.
%d
would mean digit,
%s
would mean string, etc etc.