Greet the Visitors
Python
15 pts
Greet the Visitors
Loop over the set visitors in alphabetical order.
- For each name, print
Hello, NAME! - In the same loop, add the length of each name to
total_letters. - After the loop, print
Total letters:and the number.
Expected output:
Hello, Abel! Hello, Merhawi! Hello, Ruta! Hello, Selam! Total letters: 20
Checklist
- Keep
visitorsunchanged. Starttotal_lettersat0and add the length of each name inside the loop. - Greet each visitor in alphabetical order, then print the total letters.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
