Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count = 0
- all_ans = []
- for a in range(30):
- for b in range(30):
- for c in range(30):
- for d in range(30):
- test1 = a + b + a
- test2 = a + c + c
- test3 = c + d + d
- if (test1 == 30 and test2 == 16 and test3 == 21):
- count += 1
- ans = a + c + d
- all_ans.append(ans)
- print("-------- [RESULT {}] --------".format(count))
- print("TEST 1: a({0})\t+\tb({1})\t+\ta({0})\t=\t{2}".format(a, b, test1))
- print("TEST 2: a({0})\t+\tc({1})\t+\tc({1})\t=\t{2}".format(a, c, test2))
- print("TEST 3: c({0})\t+\td({1})\t+\td({1})\t=\t{2}".format(c, d, test3))
- print("ANSWER: a({})\t+\tc({})\t+\td({})\t=\t{}".format(a, c, d, ans))
- print("-------- [ANSWER] --------")
- print("POSSIBLE ANSWER: {}".format(repr(list(set(all_ans)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement