Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
24 lines (24 sloc) 491 Bytes
metadata:
title: Number as word
example start: 2
example end: 2
documentation: "https://docassemble.org/docs/functions.html#nice_number"
---
modules:
- random
---
question: |
There are ${ nice_number(toads) }
toads and ${ nice_number(frogs) }
frogs in the pond.
buttons:
- Restart: restart
sets: all_done
---
initial: True
code: |
toads, frogs = 15, 15
while toads > 10 and frogs > 10:
toads = int(2 + random()*18)
frogs = int(2 + random()*18)
need(all_done)