Skip to main content

Division

src/division.py
from nada_dsl import *

def nada_main():
party_alice = Party(name="Alice")
party_bob = Party(name="Bob")
party_charlie = Party(name="Charlie")
numerator = SecretInteger(Input(name="numerator", party=party_alice))
denominator = SecretInteger(Input(name="denominator", party=party_bob))
quotient = numerator / denominator
return [Output(quotient, "quotient", party_charlie)]

Run and test the division program

1. Open "Nada by Example"

Open in Gitpod

2. Run the program with inputs from the test file

nada run division_test

3. Test the program with inputs from the test file against the expected_outputs from the test file

nada test division_test
Feedback