Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Number Game
- # Goal: Find the values of s s.t it satisfies the system of eqations:
- #
- # C T S
- # + C T S
- # + C T S
- #___________
- # S S S
- # The digit zero is not allowed
- solutions = []
- possibilities = []
- for num in range(1,10):
- C = num
- for num in range(1,10):
- T = num
- for num in range(1,10):
- S = num
- possibilities.append((C,T,S))
- for possibility in possibilities:
- C = possibility[0]
- T = possibility[1]
- S = possibility[2]
- if 3*(C*100+T*10+S) == (T*100+T*10+T): #Checks the digits for each position (All work except for Circle? ( C ) )
- solutions.append('Solution(s) found: The number, '+str(S)+' as shown: '+str(possibility))
- if solutions == []:
- print("No solutions")
- print(solutions)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement