
February 14th, 2013, 12:06 PM
|
 |
Contributing User
|
|
Join Date: May 2012
Location: 39N 104.28W
Posts: 97
Time spent in forums: 1 Day 15 h 24 m 4 sec
Reputation Power: 2
|
|
I'm not all that familiar with Python 3 (which it seems you're using) but I think the problem is in the first of your 2 "print("#")"s. That is, the default is to add a linefeed so you should have "print("#", end="")" or whatever is the proper syntax.
Also, it helps if you use code tags and thus preserve the indentation (although in this case it's fairly transparent).
By the way, in Python 2.x, I'd do it like this (where "n" is your numsteps):
Code:
>>> for i in xrange(n):
... print "#"+i*"_"+"#"
##
#_#
#__#
#___#
#____#
#_____#
Last edited by rrashkin : February 14th, 2013 at 12:15 PM.
Reason: on second thought
|