Recursive triangle python, if type(x) != int or type(n