Streamlit ignore Code

Is there a way to have streamlit ignore a certain code block using a magic or some preference?

I’ve used if-then statements a lot to hide elements/or code blocks, but I know what you mean. A giant If statement doesn’t really sit right.

Is that sort of the reason you want an ignore-code statement?