App Py
App Py
def get_input():
value = float(input("Entrez la valeur à convertir: "))
from_unit = input("Entrez l'unité d'origine: ").lower()
to_unit = input("Entrez l'unité de destination: ").lower()
return value, from_unit, to_unit
def main():
print("CONVERTISSEUR D'UNITÉS")
print("1. Pression")
print("2. Longueur")
print("3. Surface")
choice = input("Choisissez une catégorie: ")
if choice == '1':
result = convert_pressure(value, from_unit, to_unit)
elif choice == '2':
result = convert_length(value, from_unit, to_unit)
elif choice == '3':
result = convert_surface(value, from_unit, to_unit)
else:
print("Choix non valide")
return
if __name__ == "__main__":
main()