Godbolt does Python! (And lots of other languages…)

import cmath

# Set how far to zoom into the set, you can tweak this value
scale = 25

# Calculate if each point in an x-y plane "escapes" the shape
for y in range(-12, 12):
for x in range(-55, 45):

# Create a complex number based on current coordinates
# Note the fudge factor of 2 because characters are taller than high
c = complex(x / scale, y / scale * 2)

# Initialise the calculation
z = 0

# Check if calculation remains bounded (stays on the page)
for _ in range(20):

# THE IMPORTANT BIT!
# https://en.wikipedia.org/wiki/Mandelbrot_set

z = z * z + c

# These numbers can get pretty big very quickly
# So quit the loop if the result is already off the page
if abs(z) > 9:
z = 0
break

# Print this point
print(chr(int(abs(z) > 0) + 32), end="")

# Print a New line at the end of each row
print("")


https://godbolt.org/z/oco7KGbjb

Output:


!!
!!!!!
!!!!!!
! ! !!!!!!!!!!!! !!    !
!!!!!!!!!!!!!!!!!!!!!!! !
!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!
!     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!! !!!!!!
!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!! !
! ! !!!!!!!!!!!! !!    !
!!!!!!
!!!!!
!!