Last active
November 1, 2025 17:37
-
-
Save caruccio/f84b5caaa7c9a64e372277a26e9ba8f0 to your computer and use it in GitHub Desktop.
Calculadora de Pizza
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| def pizza(qtd_bolas: int, peso_bola: int, hid: int = 75) -> dict: | |
| peso_total = qtd_bolas * peso_bola | |
| sal_g = peso_total * 0.02 | |
| ferm_g = 1 | |
| agua_g = (peso_total / (hid + 100)) * 70 | |
| farinha_g = peso_total - sal_g - agua_g | |
| items = [('farinha', farinha_g), ('agua', agua_g), ('ferm', ferm_g), ('sal', sal_g)] | |
| return dict(items) | |
| b = 6; b = int(input(f'Qtd de pizzas [{b}]: ') or b) | |
| p = 280; p = int(input(f'Peso/pizza [{p}]: ') or p) | |
| h = 75; h = int(input(f'% hidratacao [{h}]: ') or h) | |
| p = pizza(b, p, h) | |
| print('-' * 19) | |
| print('\n'.join([ f'{i:10}: {v:0.2f}g' for i, v in p.items()])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment