Computer Programming

For my Show Off project, I created a Python program that guesses what animal you’re thinking of from a list. It does this by asking a series of yes or no questions, using traits like “has a tail”, “can bark”, or “lives in water”, until it narrows it down to just one animal. It uses recursive functions, dictionaries, while loops, and functions with parameters, all of which were concepts we learned in Unit 4.

At first, I wasn’t sure how to make the program keep narrowing down the list without making it super repetitive. Once I understood how recursion works, I realized I could make the program call itself after every question, using a smaller list of animals each time. That made my code a lot shorter and smarter. I also used a dictionary to store which animals have which traits, which made it easier to compare answers.

I can experiment with different ways of doing something. (CRITICAL THINKING)
I tried using both loops and recursion before deciding that recursion was the best way to keep the questions going until one animal was left. This helped me better understand how recursive functions actually work.

I can generate new ideas as I pursue my interests. (CREATIVE THINKING)
I came up with the idea to make a guessing game because I’ve always liked that type of program. I wanted to challenge myself to make the computer seem like it was “thinking.”

I can monitor my progress and adjust my actions to make sure I achieve what I want. (CRITICAL THINKING)
When something didn’t work or the program guessed wrong, I would go back and check my logic, fix my conditions, and test again. This helped me stay on track and end up with a working program.

If I did this again, I’d add even more animals and traits, or maybe let the user teach the program a new animal if it doesn’t guess correctly. But I’m really happy with how it turned out, and I feel like I understand recursion and dictionaries much better now.