scripts/bread.py

25 lines
1.1 KiB
Python
Executable File
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

#!/usr/bin/env python3
quantite_farine = eval(input('Quelle quantité de farine (en gramme)?\n'))
print('Quelle proportion d\'eau (en pourcent)?')
proportion_eau = eval(input())
proportion_eau_levain = eval(input('Pour 100 g de farine, combien mets-tu d\'eau dans ton levain?\n'))
pourcent_eau_levain = (100 * proportion_eau_levain) / (100 + proportion_eau_levain)
tiers = 1.0 / 3
total_levain = quantite_farine * tiers
quantite_eau_dans_levain = total_levain * (pourcent_eau_levain / 100)
total_eau = (quantite_farine * (proportion_eau / 100))
eau_a_ajouter = total_eau - quantite_eau_dans_levain
quantite_farine_dans_levain = total_levain - quantite_eau_dans_levain
farine_a_ajouter = quantite_farine - quantite_farine_dans_levain
sel = quantite_farine * (8 / 500)
print('Pour ton pain avec ' + str(quantite_farine) + ' g de farine, il faut:')
print(str(total_levain) + ' g de levain et')
print(str(total_eau) + ' g d\'eau,')
print('c\'est-à-dire ' + str(eau_a_ajouter) + ' g d\'eau à ajouter,')
print('et ' + str(farine_a_ajouter) + ' g de farine à ajouter,')
print('et n\'oublie pas ' + str(sel) + ' g de sel!')