I'm am trying to a basic GUI which prints a space or a star depending on the number. However, my code won't print it in the format I want it to. My code is:
picture = [
[0,0,0,1,0,0,0],
[0,0,1,1,1,0,0],
[0,1,1,1,1,1,0],
[1,1,1,1,1,1,1],
[0,0,0,1,0,0,0],
[0,0,0,1,0,0,0]
]
for image in picture:
for pixel in image:
if pixel == 0:
print(" ")
elif pixel == 1:
print("*")
My expected output is:
*
***
*****
*******
*
*
My actual output is:
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
This is proving really hard and help would be appreciated.