- This topic has 1 reply, 2 voices, and was last updated 2 years, 7 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Fórum Lógica de Programação: O Guia Completo › resultado = None
Usei a variável com valor None, ma se tiver a saída Valor inválido ela não é mostrada:
resultado = None
Código
if resultado != None:
print(‘Resultado:’, resultado)
Gostaria de saber se esta solução seria a melhor.
Muito obrigado.
Olá Balbino,
Sim, sua solução é melhor, pois evita exibir um resultado inexistente.