def factorial(n) {
factorial is 1;
iterate range(1, n+1) with i {
factorial is factorial * i;
}
return factorial;
}