Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: The Digital Tea Kettle | Asynchronous Programming (asyncio)
Python Structural Programming
Sezione 4. Capitolo 3
single

single

Challenge: The Digital Tea Kettle

Scorri per mostrare il menu

Compito

Scorri per iniziare a programmare

Create a coroutine that simulates a digital tea kettle boiling water.

  • Define a coroutine function called boil_water using the async keyword.
  • 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.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 4. Capitolo 3
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt