Quick actions

cmd+k|ctrl+k

Navigation

Languages

1st GUI

Snippet info

Language

Python

Visibility

public

Author

fpuleano

Created

2022-02-17T15:43:32.873265Z

Updated

2022-02-19T16:10:07.32571Z

# Exercise
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]
    ]
    
    #1 We want to iterate over picture
    # 2 if 0 -> print ' '
    # 3 if 1 -> print '*'
    
for row in picture:
        for pixel in row:
            if (pixel):
                print('*', end='')
                #the end=' ' is used to place a space after the displayed string instead of a newline.
            else:
                print(' ', end='')
        print(' ')
             
                
    
INFO