Display a tally (in varying bases)
Python 2 - 111 108 119 144 140 136 135 134 - Try it

Ok, let's give it a try:

i=input()
n,b=[(i,5),i][i&gt;[]]
o=b-1
a=[n,n%b][b&gt;1]*' |'
m=(b&gt;1)*n/b
s=(' |'*o+'  ')*m+a
print(s+'\n'+('-+'*o+'- ')*m+a+'\n'+s)*(b*n&gt;0)


Edit: I've overlooked that there should be no output if n==0 or b==0. This costs me 11 characters. :(

Edit: Ok, after fixing the second issue mentioned in the comments my solution basically converged to the one from BeetDemGuise.