Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #Number Game
  2.  
  3. # Goal: Find the values of s s.t it satisfies the system of eqations:
  4. #
  5. # C T S
  6. # + C T S
  7. # + C T S
  8. #___________
  9. # S S S
  10. # The digit zero is not allowed
  11. solutions = []
  12. possibilities = []
  13. for num in range(1,10):
  14. C = num
  15. for num in range(1,10):
  16. T = num
  17. for num in range(1,10):
  18. S = num
  19. possibilities.append((C,T,S))
  20. for possibility in possibilities:
  21. C = possibility[0]
  22. T = possibility[1]
  23. S = possibility[2]
  24. if 3*(C*100+T*10+S) == (T*100+T*10+T): #Checks the digits for each position (All work except for Circle? ( C ) )
  25. solutions.append('Solution(s) found: The number, '+str(S)+' as shown: '+str(possibility))
  26. if solutions == []:
  27. print("No solutions")
  28.  
  29. print(solutions)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement