How to use if else statement in diamond star printing

Please first read the pinned thread in order to understand how to make the code show up properly. Indentation is important in Python, so we need to see it properly so we can understand the attempt you made so far.