Skip to content

Instantly share code, notes, and snippets.

@caruccio
Last active November 1, 2025 17:37
Show Gist options
  • Save caruccio/f84b5caaa7c9a64e372277a26e9ba8f0 to your computer and use it in GitHub Desktop.
Save caruccio/f84b5caaa7c9a64e372277a26e9ba8f0 to your computer and use it in GitHub Desktop.

Revisions

  1. caruccio revised this gist Nov 1, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion pizza.py
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ def pizza(qtd_bolas: int, peso_bola: int, hid: int = 75) -> dict:
    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)
    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)
  2. caruccio created this gist Nov 1, 2025.
    17 changes: 17 additions & 0 deletions pizza.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/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()]))