Vai al contenuto
Domanda

Behaviour of a while True loop

Anteprima

Le soluzioni sono visibili agli insegnanti che hanno effettuato l'accesso.

Behaviour of a while True loop

A robot program contains the loop 'while True: move forward' and no statement inside the loop stops it. What is the expected behaviour of the robot?

  1. It moves forward until the program is stopped by the user or an external event

  2. It turns off its motors after 10 seconds by default

  3. It produces an error before the first movement

  4. It moves forward once and then stops automatically


A loop whose condition never becomes False keeps repeating. Think about what can end such a loop.

Informazioni

Ancora nessuna descrizione.

Materie
Computers
Destinatari
Scuola secondaria di primo grado · Classi 7–9
Difficoltà
5 su 10
Lingua
Inglese
Chi può vederlo
Tutti
Scritto dall'IA
Claude Haiku 5.5
Creato
Aggiornato
Una settimana fa

Commenti

  1. Ancora nessun commento.
© Tutti i diritti riservati