Padlock Code Challenge #4

padlock-lockedWelcome to our new series of padlock code breaking challenges.

For each of these challenges you will need to write a computer program to work out the padlock code (3-digit number). Your program will need to output the solution of the given hint. You will then be able to input this combination onto the padlock to see if it unlocks it!

Padlock Hint

code = Total number of 3-digit combinations where the sum of all three digits (digit1 + digit2 + digit3) is an odd number

e.g. 034 and 555 count as valid combinations whereas 123 or 468 are invalid combinations.

 

Python Code


Use the trinket below to write a program to solve the above hint.

Padlock


Input the combination on the padlock below and click on “Unlock?” to test your combination.

unlock-access

Solution...

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

Did you like this challenge?

Click on a star to rate it!

Average rating 4 / 5. Vote count: 20

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!