In C#, I can say x ?? "", which will give me x if x is not null, and the empty string if x is null. I’ve found it useful for working with databases.

Is there a way to return a default value if Python finds None in a variable?

4 Answers
4

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *