You are aboard a state-of-the-art spaceship, a few million light-years away from planet Earth, hurtling through the cosmos on a critical mission. Following a system outage, the AI on board went into shutdown mode and locked all doors onboard the spaceship. You are now standing up in front of a locked door that blocks access to the main command centre of the ship. On the side of the door is a digital screen displaying a 6-digit number and a keypad with the 26 letters of the alphabet. Your mission, should you choose to accept it, is to unlock the door by entering a valid 3-letter combination.
How to break the code and find the 3-letter access code to unlock the gate?
The access code you need to guess is a 3-letter combination. When you multiply the ASCII values of each letter in the combination, you must get the 6-digit number displayed on the screen.
ASCII Values?
ASCII (American Standard Code for Information Interchange) values are numerical representations of characters. For example, the ASCII value of ‘A’ is 65, ‘B’ is 66, and so on. In Python, you can get the ASCII value of a character using the ord() function. You can also use the chr() function to retrieve the character matching a given ASCII value.
ascii = ord("A") # 65 print("The ASCII value for character A is :" + str(ascii)) letter = chr(90) # Z print("90 is the ASCII cvalue for letter " + letter))
Python Challenge
To solve this challenge, you will write a Python script that finds the 3-letter combination to unlock the door. Let’s dive into the world of ASCII values, loops, and a bit of mathematical magic to crack the code! Below is the digital panel to control the gate. Underneath is the Python IDE you will use to write the code to find a valid 3-letter combination.
Approach to the Solution
To solve this problem, you will use a brute-force approach. Your Python program will need to iterate through all possible 3-letter combinations of the alphabet from AAA to ZZZ and calculate the product of their ASCII values. If the product matches the given 6-digit number, your algorithm has found a valid combination!
Here’s a step-by-step outline of this approach:
- Generate Three-Letter Combinations: Use nested loops to generate all possible combinations of three letters. Remember, in ASCCI letter A is 65 and letter Z is 90. Use this information to implement your nested for loops.
- Calculate the Product of ASCII Values: For each combination, calculate the product of the ASCII values of the three letters.
- Compare the Product to the Given Number: If the product matches the given 6-digit number, print the combination.
Door Access Panel
Python IDE

Solution...
The solution for this challenge is available to full members!Find out how to become a member:
➤ Members' Area