let list = [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
];
fn squared(x) {
return x * x;
}
while (list.len() > 0) {
let item = list[0];
list = list.remove(0);
if (item % 2 == 0) {
print(format("{}: even", item));
print(format("{} squared is {}", item, squared(item)));
} else {
print(format("{}: odd", item));
print(format("{} squared is {}", item, squared(item)));
}
}