python/CodeChallenge_2.py

11 lines
273 B
Python

class Solution(object):
def solve(self, n:int) -> str:
print(f"n: {n}")
s = list(str(n))
for i in range(len(s)):
if s[i] != '4' and s[i] != '7':
return "NO"
return "YES"
s = Solution()
print(s.solve(47))