Skip to main content

Multiplication

src/multiplication.py
from nada_dsl import *

def nada_main():
party_alice = Party(name="Alice")
party_bob = Party(name="Bob")
party_charlie = Party(name="Charlie")
num_1 = SecretInteger(Input(name="num_1", party=party_alice))
num_2 = SecretInteger(Input(name="num_2", party=party_bob))
product = num_1 * num_2
return [Output(product, "product", party_charlie)]

Run and test the multiplication program

1. Open "Nada by Example"

Open in Gitpod

2. Run the program with inputs from the test file

nada run multiplication_test

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

nada test multiplication_test
Feedback