I'm trying to make a rectangle out of a given symbol with a specific given height and width. The first def function should contain only one parameter. This should be a higher-order function as well. This is my code so far:
def rectangle(x):
def someName(width,height):
i = x * width
while len(i) <= height:
print(i)
i = i+1
return someName
If entering something like this to test it, this is how it should print:
>>> percent = rectangle('%')
>>> dot = rectangle('.')
>>> print(percent(3,2))
%%%
%%%
>>> print(dot(4,1))
....
My code currently returns None. How do I get it to return i? If I change return someName to return i, many other errors occur.