how to triangle program in python