I need to write a function which has 2 parameters height and width and outputs a rectangle of "#" ssmbol of the appropriate dimensions. so for 93, 4) should result in the output

but i dnt unserstand how to use the loop in this. I have only done loops once til nw and i tried using that code for this one but i get error everytime, probably coz the whole code is wrong. This is my first code i did using loop which is correct. But i cant seem to know how to do the second one?. I know the code i have done for the second one is not very much and probably wrong, If you guys could atleast provide me with a example it would do, if you think i am asking you to do the h/w for me thing..

word=raw_input("please enter the word for the song :")
repeat=input("how many times should the song be repeated? :")
lines=input("how many lines should the song be for? :")
for i in range(lines):
     print word*repeat
def drawBlock(height, width):
    for i in range(drawBlock):
     print x
7 Years
Discussion Span
Last Post by vegaseat

try this:

>>> w = 4
>>> h = 3
>>> for i in range( h ):
	print w * "# "

# # # # 
# # # # 
# # # # 

Edited by masterofpuppets: n/a


jaison2, range(drawBlock) in your code does not make any sense, since range() expects an integer value. In your loop you want something like this ...

for row in range(height):
    # multiplier will give width number of '#' characters
    print '#' * width

Edited by vegaseat: hint

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.