Hollow pattern using / and _ and | right angle triangle
Answer to the question
def repiter(re_num,sym):
i=0
result=""
while i<re_num:
result=result+sym
i=i+1
return(result)
num=int(input("Height of a right triangle. Please enter an integer: \n"))
num=num-1
i=0
while i<num:
print(repiter(num-i," ")+"/"+repiter(i," ")+"|")
i=i+1
else:
sym=repiter(i,"_")
print("/"+sym+"|")
Comments
Leave a comment