Course of Raku / Essentials / Loops / Exercises

Echo until enough

Problem

Write a program that repeatedly asks to enter a word and prints it in the terminal. If the word is enough, the program terminates and prints a final message.

Example

The program may run infinitely long, but here we only show a couple of iterations.

$ raku echo-until-enough.raku
Your word: language
language
Your word: coding
coding
Your word: enough
OK, done.

Solution

See the solution

Next exercise

💪 Division via subtraction

Course navigation

Conditional checks / Ternary operator   |   Data type conversion

Translations of this page: EnglishDeutschEspañolItalianoLatviešuNederlandsБългарскиРусскийУкраїнська