Défi : Recherche d'Animaux dans le Zoo
Tâche
Swipe to start coding
Vous disposez d'un tableau appelé animalsInZoo :
["Lion", "Tiger", "Elephant", "Giraffe", "Panda"]
Vos tâches :
- Écrire trois conditions séparées
if...elsepour vérifier si les animaux suivants existent dans le zoo :"Lion","Zebra","Panda" - Pour chaque animal :
- S'il existe, retourner :
"Yay! We have a [animal] in our zoo!" - S'il n'existe pas, retourner :
"Oh no! No [animal] in our zoo today."
- S'il existe, retourner :
- Retourner les trois messages dans un tableau dans le même ordre.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 5. Chapitre 11
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
Génial!
Completion taux amélioré à 1.35
Défi : Recherche d'Animaux dans le Zoo
Glissez pour afficher le menu
Tâche
Swipe to start coding
Vous disposez d'un tableau appelé animalsInZoo :
["Lion", "Tiger", "Elephant", "Giraffe", "Panda"]
Vos tâches :
- Écrire trois conditions séparées
if...elsepour vérifier si les animaux suivants existent dans le zoo :"Lion","Zebra","Panda" - Pour chaque animal :
- S'il existe, retourner :
"Yay! We have a [animal] in our zoo!" - S'il n'existe pas, retourner :
"Oh no! No [animal] in our zoo today."
- S'il existe, retourner :
- Retourner les trois messages dans un tableau dans le même ordre.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 5. Chapitre 11
single