I have a long snippet of code and i am trying to shorten it. This is what I have now:
statuses = cleaned_data.get("statuses")
if statuses:
for status in statuses:
...
it would be nice if i can assign the value of cleaned_data.get("statuses")
inside the if condition, like this:
if cleaned_data.get("statuses") as statuses
and carry on.
Is it doable in python?