[Tutor] (no subject)

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Sun Nov 16 17:36:27 EST 2003



On Thu, 13 Nov 2003 classyjoes at btopenworld.com wrote:

> I'm trying to create a function that accepts two parameters, it takes
> the size of a side of a square to print and the ASCII character that
> this square is made up of. I then need to call it in a calling program.
> Any ideas would be so greatly appreciated!!!


Hi Martyn,

Ask us what problems you're having with, and we'll try to help as best we
can.  Your problem does sounds like homework, though, so we're fairly
restricted to what we can say comfortably.


You may want to try a simpler problem to get more familiar with Python and
programming.  One approach to solving things like this is to make the
problem easier: since you're drawing something in two dimensions, one
simplification is drop down to one dimension.

Can you write a program that takes a numeric length, and draws a line with
that many dashes?  This problem should be easier to solve.  And if can
draw a line, then drawing a square should be a bit simpler to do.


If you want supplementary tutorial on learning how to program, you can
find more stuff here:

    http://www.python.org/topics/learn/non-prog.html



Good luck to you!




More information about the Tutor mailing list