Printing dynamic ascii-art shapes based on user input
I couldn't figure out a cleaner solution than an infinite loop. Is this approach considered bad practice?

You can't do much better, since Python doesn't have the equivalent of a C-style do/while.
This is a trivial program so I doubt it's even worth adding functions (etc.); the one thing that can be improved is
if (z &gt;= 0 and z &lt;= 20):

can be
if 0 &lt;= z &lt;= 20: