As pointed out by @BarryNorthey the specific syntax error you are getting is due to a lack of a colon after your function definition line.
Since you are new to Python, I will also point out that best practice according to https://peps.python.org/pep-0008/ :
Comparisons to singletons like None should always be done with is or is not, never the equality operators.
So, in this case your syntax should not be
if ( LC01 == None ) : # which by the way you forgot another colon.
but should be
if ( LC01 is None ) :
As @DanPatterson has already pointed out, for a simple conditional check like this you can rely on Python's conditional expression, aka ternary operator, to handle it rather than defining a function in the code block.
"04" if !LC01! is None else !LC01!