https://community.esri.com/migrated-users/3420
,
You are correct, I should not assume Justin would understand how to place a def in a code block. I was also using my phone to reply while traveling. Below are the call, def and a Calculate Field screen shot to use a function called "joinAddress" with the needed address fields which returns the assembled address string less any None values.
You call the function using:
joinAddress(!AddrPrimaryHighNo!, !StreetPreDrctnAbbrev!, !StreetName!, !StreetSuffixAbbrev!, !StreetPostDrctnAbbrev!)
The Code Block:
def joinAddress(a,b,c,d,e):
flds = [a,b,c,d,e]
return " ".join([str(i) for i in flds if i is not None])
Side note: If all your fields were string you could also use " ".join(filter(None, flds)). You can still use this by changing the following; flds = [str(a),b,c,d,e]. I prefer the method above as you can also change the str(i) to str(i).strip() to remove any leading or training spaces that may be in your fields.
Calculate Field:

If you do not want to use the code block with a call, you can use the following as a calculate statement:
" ".join([str(i) for i in [!AddrPrimaryHighNo!, !StreetPreDrctnAbbrev!, !StreetName!, !StreetSuffixAbbrev!, !streetPostDrctnAbbrev!] if i is not None])