Rectangles in functions?

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2009
Posts: 33
Reputation: jaison2 is an unknown quantity at this point 
Solved Threads: 1
jaison2 jaison2 is offline Offline
Light Poster

Rectangles in functions?

 
0
  #1
Nov 7th, 2009
hi basically i have to write a function which draws 4 rectangles next to eachother(consisting of spcaes then hashes then spaces then finally hashes, all of the same height). the rectangles final The rectangles common height,and the width of the four rectangles should be parameters, e.g.(3, 0, 5, 4, 2) will output.

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

heres my current code. the drawBlockC function is the second part of the answer.

def drawBlock(height, width):
for i in range( height ):
print width * "# "

def drawLetterC():
drawBlock(1, 7)
drawBlock(1, 7)
drawBlock(1, 2)
drawBlock(1, 2)
drawBlock(1, 7)
drawBlock(1, 7)
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 243
Reputation: masterofpuppets is an unknown quantity at this point 
Solved Threads: 60
masterofpuppets's Avatar
masterofpuppets masterofpuppets is offline Offline
Posting Whiz in Training
 
0
  #2
Nov 8th, 2009
hi,
I didn't quite understand the specification of the function that you want to write. Especially this part

the rectangles final The rectangles common height,and the width of the four rectangles should be parameters, e.g.(3, 0, 5, 4, 2) will output.

##### ##
##### ##
##### ##
Do you need only the width and height of the rectangles or is there something else as well, because you say you need 4 rectangles but the output has only 2

P.S. sorry if i missed something in the spec.
Last edited by masterofpuppets; Nov 8th, 2009 at 10:04 am.
My site ->> http://8masterofpuppets8.webs.com/
"My belief is stronger than your doubt."
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 33
Reputation: jaison2 is an unknown quantity at this point 
Solved Threads: 1
jaison2 jaison2 is offline Offline
Light Poster
 
0
  #3
Nov 8th, 2009
Originally Posted by masterofpuppets View Post
hi,
I didn't quite understand the specification of the function that you want to write. Especially this part



Do you need only the width and height of the rectangles or is there something else as well, because you say you need 4 rectangles but the output has only 2

P.S. sorry if i missed something in the spec.
This is just an example... we just need to create a function which can draw upto 4 rectangles.. even i dnt relly get this question thts y i am looking for help..lol
Reply With Quote Quick reply to this message  
Reply

Message:




Views: 205 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Python
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC