python/Fonctions/convertisseur.py
2023-01-12 14:57:48 +01:00

20 lines
370 B
Python

def convert(val: float,unite: str):
if unite == "g":
livre = val * 0.002205
print(livre, end=" l")
if unite == "m":
pied = val / 0.3048
print(pied, end=" p")
if unite == "c":
fahr = 32 + 1.8 * val
print(fahr, end=" f")
print()
valeur, unite = input().split()
convert(float(valeur),unite)