[pythonvis] Re: My box drawing program, finally!

  • From: Sharon Hooley <shooley2@xxxxxxxxxx>
  • To: "pythonvis@xxxxxxxxxxxxx" <pythonvis@xxxxxxxxxxxxx>
  • Date: Sun, 18 May 2014 15:03:12 -0600

 How do you make the bars for the sides?  Thanks for providing this exercise.


Sent from my iPhone

> On May 18, 2014, at 2:45 PM, Richard Dinger <rrdinger@xxxxxxxxxx> wrote:
> 
> Congratulations JDog, the first complete program on the list.
> 
> And it works--well done!
> 
> Richard
> 
> 
> -----Original Message----- From: Jeffrey Turner Sent: Sunday, May 18, 2014 
> 1:21 PM To: pythonvis@xxxxxxxxxxxxx Subject: [pythonvis] My box drawing 
> program, finally! 
> This is very simple and rudimentary, but I had fun writing it.
> 
> JDog
> 
> """ This program will draw a box according to width and height specs
> provided by the user"""
> 
> print "I will now draw a box for you, with pretty plus signs for the
> corners, "
> print "dashes for the top and bottom, and bars for the sides."
> print
> width = input("How wide would you like the box to be?")
> print
> height = input("How high would you like the box to be?")
> corner = "+"
> dashes = width*"-"
> indent = " "*3
> bar = "|"
> spaces = " "*width
> print
> top = bottom = indent+corner+dashes+corner
> print top sides = indent+bar+spaces+bar
> count = height
> while count >= 1:
> print sides
> count = count-1
> print bottom
> print
> print "OK, here is your", width, "by", height, "box."
> print "Thank you for doing business with the marvelous JDog."
> 
> 

Other related posts: