python how to write one line if statement

I am trying to write a one line if statement with no else. What is the correct way to do this? I do not want an else.

PODQS1_R10 = ""
PODQS2_R11 = ""
PODQS3_R12 = ""
    
PODQS1_R10 = "4751" if row[10] == "4751"


Read more here: https://stackoverflow.com/questions/66324811/python-how-to-write-one-line-if-statement

Content Attribution

This content was originally published by bakalolo at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: