Boxes of O's
MRAB
python at mrabarnett.plus.com
Sat Mar 1 14:41:30 EST 2014
On 2014-03-01 19:28, geniusrko at gmail.com wrote:
> Well, This is what i got
>
> n = int(input("enter number of o: "))
>
> for i in range(n):
> print("O", end = '')
> for j in range(n* 2):
> print("O", end = '')
>
> print()
>
From the examples:
The first row has n*2 of 'o'
There are n-2 middle rows, each with 'o', then n*2-2 spaces, then 'o'
The last row has n*2 of 'o'
Incidentally, in your code you're writing 'O', not 'o'.
More information about the Python-list
mailing list