Code:
def next_bunny(bpop,fpop): bpop_next = (10*bpop)/(1+0.1*bpop) - 0.05*bpop*fpop return max(int(bpop_next), 0) def next_fox(bpop,fpop): fpop_next = 0.4 * fpop + 0.02 * fpop * bpop return max(int(fpop_next), 0) bPOP = float(raw_input("Number of bunnies ==> ")) fPOP = float(raw_input("Number of foxes ==> ")) print "Year 1 : %d,%d " %(bPOP,fPOP) print "Year 2 : %d,%d " %(next_bunny(bPOP,fPOP),next_fox(bPOP,fPOP)) print "Year 3 : %d,%d " %(next_bunny(next_bunny(bPOP,fPOP), next_fox(bPOP,fPOP)), next_fox(next_bunny(bPOP,fPOP),next_fox(bPOP,fPOP))) print "Year 4 : %d,%d " %(next_bunny(next_bunny(next_bunny(bPOP,fPOP), next_fox(bPOP,fPOP)),next_fox(next_bunny(bPOP,fPOP),next_fox(bPOP,fPOP))), next_fox(next_bunny(next_bunny(bPOP,fPOP), next_fox(bPOP,fPOP)),next_fox(next_bunny(bPOP,fPOP),next_fox(bPOP,fPOP)))) print "Year 5 : %d,%d " %(next_bunny(next_bunny(next_bunny(next_bunny(bPOP,fPOP), next_fox(bPOP,fPOP)),next_fox(next_bunny(bPOP,fPOP),next_fox(bPOP,fPOP))), next_fox(next_bunny(next_bunny(bPOP,fPOP), next_fox(bPOP,fPOP)),next_fox(next_bunny(bPOP,fPOP),next_fox(bPOP,fPOP)))), next_fox(next_bunny(next_bunny(next_bunny(bPOP,fPOP), next_fox(bPOP,fPOP)),next_fox(next_bunny(bPOP,fPOP),next_fox(bPOP,fPOP))), next_fox(next_bunny(next_bunny(bPOP,fPOP), next_fox(bPOP,fPOP)),next_fox(next_bunny(bPOP,fPOP),next_fox(bPOP,fPOP)))))
If you can read it and tell what it's supposed to do, then I'll go to your house and fistbump you on the shoulder, and I'll raise my hands in the air and say "HELL YEAH, MAN! YOU DID IT!"