Skip to content · ⁨Lompat ke konten⁩

Count the letters · ⁨Hitung jumlah huruf⁩

English

Count the letters

word is "banana". Use a for loop to count its letters into n. Do not use len.

A counter lives outside the loop (so it is not reset every turn) and grows inside it. That shape — set up, loop, use — comes back constantly.

Bahasa Indonesia

Hitung jumlah huruf

word adalah "banana". Gunakan perulangan for untuk menghitung hurufnya ke dalam n. Jangan gunakan len.

Pencacah hidup di luar perulangan (sehingga tidak direset setiap giliran) dan bertambah di dalamnya. Bentuk itu — setup, loop, gunakan — muncul terus-menerus.

Log in or create account · ⁨Masuk atau buat akun⁩

IGCSE, A-Level & AP