Jan-09-2024, 11:11 PM
(This post was last modified: Jan-09-2024, 11:11 PM by deanhystad.)
global is not applicable here.
I think your pattern is fine. Sometimes I do this when I need to initialize a variable to one of two values based on a condition.
I think your pattern is fine. Sometimes I do this when I need to initialize a variable to one of two values based on a condition.
a = b if condition else cIf you want to know how to make sure a variable is assigned when you assign in a loop, provide an example that uses a loop.