I have to do a hash triangle using this function:
def line(num=int, word=str):
if word == "":
print("*" * num)
else:
print(word[0] * num)
Here is the code i have:
def line(num=int, word=str):
if word == "":
print("*" * num)
else:
print(word[0] * num)
def triangle(size):
# You should call function line here with proper parameters
while size > 0:
line(size, "#")
size -= 1
the output is this:
######
#####
####
###
##
#
but it should be this:
#
##
###
####
#####
######
how can i modify it so it prints that?