# -*- coding: utf-8 -*-
# Calcul du pourcentageage
# v.2

print("Calcul du pourcentageage")
print("------------------------")

valeur_totale = input("Valeur totale ? ")
# print()
while valeur_totale == "0" :
    print()
    print("pas asser, ou trop !")
    valeur_totale = input("Essayez encore ? ")
else :
    try :
        valeur_totale = float(valeur_totale)
    except :
        print("Prenons : 1000 pour l'exemple")
        valeur_totale = "1000"
        valeur_totale = float(valeur_totale)
print()
valeur_partielle = input ("Valeur partielle ? ")
# print()
while valeur_partielle == "0" :
    print()
    print("pas asser, ou trop !")
    valeur_partielle = input("Essayez encore ? ")
else :
    try :
        valeur_partielle = float(valeur_partielle)
    except :
        print("Essayons avec 100")
        valeur_partielle = "100"
        valeur_partielle = float(valeur_partielle)

pourcentage = valeur_partielle * 100 / valeur_totale #calcul

print()
print("Ce Pourcentage vaut:", round(pourcentage, 1), "%")
# print("Ce Pourcentage vaut:", valeur_partielle, "* 100 /", valeur_totale, "=", round(pourcentage, 1), "%")
print(pourcentage, "%")
print()

print()
print("----------------------")
bye = (input ("Entrer pour Sortir...!"))
