renix1

Alguma coisa feita em Python

Feb 23rd, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. # coding:utf-8
  2. #THEME FOR SUBLIME-TEXT = PACIFIC
  3. def conversao_km_para_metros (kmetros):
  4.     metros = kmetros*(10**3)
  5.     return(metros)
  6.  
  7. print("\t\t\t-- TESTE --\n")
  8.  
  9. kmetros = float(input("Digite a quant kmetros: "))
  10.  
  11. if len(str(kmetros)) > 0:
  12.     if kmetros > 0:
  13.         print("Metros: ", conversao_km_para_metros(kmetros))
  14.     elif kmetros < 0:
  15.         print("Não tem como converter algo negativo\n")
  16.     else:
  17.         print("Não reconhecemos isto\n")
  18. else:
  19.     print("Você não digitou nada\n")
  20. input("Esperando teclar algo\n")
Add Comment
Please, Sign In to add comment