let n = 6;
let total = 0;
for (let i = 1; i <= n; i++) {
total += i;
}
console.log(total);
/*The variable total is initialized to 0. The loop executes once each for
the values of i from 1 to 6. Each time the loop body executes, the
next value of i is added to total.*/
def num_characters(string):
total = 0
for character in string:
total += 1
return total
original_string = "The quick brown rhino jumped over the extremely lazy fox."
print(f"The numbers of characters in the original string using `len` is {len(original_string)}.")
print(f"The numbers of characters in the original string using `num_characters` is {num_characters(original_string)}.")