#中空等腰斜線三角形 def triangle(num): count = num for n in range(0,num,1): if n+1 == num: print(' '+ '/'+'_'* (2*(num-1)) +'\\') elif n == 0: print((' '*(count))+'/\\') count -= 1 else: print((' '*(count))+'/'+(' '*(2*(n))+'\\')) count -= 1 triangle(5) # /\ # / \ # / \ # / \ # /_