Created
May 30, 2019 22:31
-
-
Save pgrangeiro/fcde4e391b2fe4a80018b8ca40c6c4cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def soma(a, b): | |
try: | |
return a + b | |
except TypeError: | |
print("Não é possível somar {} com {}".format(a, b)) | |
sucesso = soma(1, 2) | |
print(sucesso) | |
>>> 3 | |
falha = soma(1, "a") | |
>>> "Não é possível somar 1 com a" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment