Section 4. Chapitre 3
single
Challenge: The Digital Tea Kettle
Glissez pour afficher le menu
Tâche
Glissez pour commencer à coder
Create a coroutine that simulates a digital tea kettle boiling water.
- Define a coroutine function called
boil_waterusing theasynckeyword. - Inside the coroutine, print
"Kettle is on...". - Simulate boiling for 3 seconds.
- After the wait, print
"Ding! Water is boiled.".
Your code should produce: Kettle is on... waits for 2 seconds Ding! Water is boiled.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 4. Chapitre 3
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion