Quick actions

cmd+k|ctrl+k

Navigation

Languages

Our First GUI

Snippet info

Language

Python

Visibility

public

Author

musicalprof

Created

2026-03-17T04:51:45.033269Z

Updated

2026-03-17T07:36:20.038736Z

# Exercise!
'''Display the image below to the right hand side where the 0 is going to be 
' ', and the 1 is going to be '*'. This will reveal an image!'''
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]
]

# fill = '$'
# empty = ' '
for image in picture:
    for pixel in image:
        print('*' if pixel else ' ', end='')
    print() # Used to make a new line after every row.
    
''' What is good code?
1. Clean - using the best/standard practices of using spaces for clean code.
2. Readability - being able to read your own code and it being easy to understand.
3. Predictability - having code that makes sense and does one thing well.
4. DRY - Do not repeat yourself! Make code reusable.'''
INFO