1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Is there shorthand for returning a default value if None in Python? [duplicate]

Discussão em 'Python' iniciado por Stack, Outubro 1, 2024 às 11:53.

  1. Stack

    Stack Membro Participativo

    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?

    Continue reading...

Compartilhe esta Página