Basic python code - how to wrap value in "for i in" loop with conditional?

You can even get syntax highlighting by specifying the language:

Also, uploading a file is good (as this lets us see how you implemented the code, set type hints etc.).