Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Dizer se um número introduzido pelo utilizador é inteiro ou decimal
  • Loading branch information
pedro-branco authored Oct 30, 2017
1 parent 6e81aad commit e43e317
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions inteiro_decimal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
inteiro ou decimal
"""

n = input("Numero?")
numDecimal = float(n)

# o truque é ver se o número convertido para inteiro é igual ao número convertido para float
numInteiro = int(numDecimal)
if numDecimal==numInteiro:
print("número inteiro")
else:
print("número decimal")

0 comments on commit e43e317

Please sign in to comment.