Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Day 5 - Halloween Coding Challenges 2023 - Python

simong1993

Diamond Coder
Staff Team
Guardian
🎃 Spooky Challenge - Day 5 🎃

The Bewitched Python's Mirror Maze

In a secluded glade within the Enchanted Forest, there stands a mysterious mirror maze. Each mirror reflects a number, and legend says that one of these numbers is not like the others. The Bewitched Python, guardian of the maze, beckons you to find the unique number that doesn't have a reflection.

Whispers in the wind recite:

Within the maze of mirrored walls,
Find the number that stands alone, answering the calls.
All others have a twin, a reflection so true,
But one number is unique, and that's your clue.

The Challenge:

You're presented with a list of numbers:

Python:
numbers = [5, 7, 9, 5, 3, 7, 9]

Your quest is to find the number that appears only once in the list.

Hint: Trust in Python's magical abilities to help you find the unique number.

🔗 Useful Resource: To harness the power of Python lists, W3Schools' Python Lists Tutorial can be your enchanted scroll.

🐍 Platform Suggestion: To navigate the mirror maze and solve the riddle, online platforms like Repl.it might be your guiding star.

Wizard of the Wild Code, by channeling the arcane arts of Python, you've navigated the perplexing mirror maze. The mirrors, although deceptive, couldn't cloud your vision.

Python:
numbers = [5, 7, 9, 5, 3, 7, 9]

def find_unique(numbers):
  for num in numbers:
    if numbers.count(num) == 1:
      return num

unique_number = find_unique(numbers)
print(unique_number)

The Bewitched Python bows to your prowess. The mirrors shimmer and reveal the unique number: "3". This solitary number had no reflection, but with your skill, it couldn't remain hidden for long.
 
Last edited:
Python:
def lowestOccurrence(list):
    lowest = []
    for x in list:
        if list.count(x) == 1:
            lowest.append(x)
    return lowest

numbers = [5, 7, 9, 5, 3, 7, 9,2]
print(lowestOccurance(numbers))
 

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom