def triangle0(num): count = num for n in range(0,num,1): #0,1,2 if n+1 == num: print(' '+ '/'+'_'* (2*(num-1)) +'\\') elif n == 0: print((' '*(count))+'/\\') count -= 1 else: print((' '*(count))+'/'+('^'*(2*(n))+'\\')) count -= 1 triangle0(5) # /\ # /^^\ # /^^^^\ # /^^^^^^\ # /________\