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 4 - Halloween Coding Challenges 2023 - Python

simong1993

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

The Python Pharaoh's Cryptic Cipher

Deep within the catacombs, where ancient mummies rest, the fourth spirit awaits. This spirit, known as the Python Pharaoh, presents a cryptic challenge. The walls of the crypt bear an inscription:

In the chambers of pyramids, where serpents hiss and slide,
A cipher lies hidden, its secrets kept inside.
Decrypt the message, with Python as your guide,
And the number you seek will no longer hide.

The Challenge:

You are handed an encrypted message:

Python:
encrypted_message = "Uifsf jt b tfdsfu ovncfs jokfefe jotjef: EFGHI"

Your task is to decrypt this message to reveal the hidden number.

Hint: In the world of ciphers, sometimes a simple shift can unveil the truth.

🔗 Useful Resource: If you need guidance on string manipulation in Python, W3Schools' Python Strings Tutorial could be a lantern in the dark.

🐍 Platform Suggestion: To decipher the Python Pharaoh's message, you might want to use an online Python environment like Repl.it or any local Python interpreter.

The Python Pharaoh's Secrets Unveiled:

Brave code adventurer, you've journeyed through the treacherous catacombs, dodging ancient traps and cryptic riddles. With Python as your trusty torch, you've illuminated the shadows and deciphered the mysterious message of the Python Pharaoh:

Python:
encrypted_message = "Uifsf jt b tfdsfu ovncfs jokfefe jotjef: EFGHI"
decrypted_message = ''.join(chr(ord(char) - 1) if char.isalpha() else char for char in encrypted_message)
print(decrypted_message)  # The walls echo back, "There is a secret number encoded inside: DEFGH"

The walls whisper tales of numbers and codes, and the hieroglyphs dance in the torchlight. The sequence "DEFGH" is a riddle within a riddle, an enigma of the ancients. But with your astute insight, you recognize this cryptic sequence as a playful representation of "01234". The heart of the mystery, the number that the Python Pharaoh guarded so jealously, is finally revealed: it is the number "0".

Rejoice, for you've cracked the code, revealing the hidden treasure! But tread lightly, for the catacombs still hold many more secrets...
 
Last edited:
Python:
def decoder(s):
    decoded = ""
    for character in s:
        if character.isalpha():
            decoded += chr(ord(character) - 1)
        else:
            decoded += character
    return decoded

print(decoder("Uifsf jt b tfdsfu ovncfs jokfefe jotjef: EFGHI"))
 

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom