Challenge: Searching for Animals in the Zoo
Task
Swipe to start coding
You are given an array called animalsInZoo:
["Lion", "Tiger", "Elephant", "Giraffe", "Panda"]
Your tasks:
- Write three separate
if...elseconditions to check whether the following animals exist in the zoo:"Lion","Zebra","Panda" - For each animal:
- If it exists, return:
"Yay! We have a [animal] in our zoo!" - If it does not exist, return:
"Oh no! No [animal] in our zoo today."
- If it exists, return:
- Return all three messages inside an array in the same order.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 5. ChapterΒ 11
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 1.35
Challenge: Searching for Animals in the Zoo
Swipe to show menu
Task
Swipe to start coding
You are given an array called animalsInZoo:
["Lion", "Tiger", "Elephant", "Giraffe", "Panda"]
Your tasks:
- Write three separate
if...elseconditions to check whether the following animals exist in the zoo:"Lion","Zebra","Panda" - For each animal:
- If it exists, return:
"Yay! We have a [animal] in our zoo!" - If it does not exist, return:
"Oh no! No [animal] in our zoo today."
- If it exists, return:
- Return all three messages inside an array in the same order.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 5. ChapterΒ 11
single