isdigit(): 문자열이 모두 숫자여야 isdigit()이 True임 def solution(s): answer=False if len(s)==4 or len(s)==6: answer = True if not s.isdigit(): answer=False return answer
isdigit(): 문자열이 모두 숫자여야 isdigit()이 True임
def solution(s): answer=False if len(s)==4 or len(s)==6: answer = True if not s.isdigit(): answer=False return answer
다른사람의 풀이 def solution(s): return s.isdigit() and len(s) in (4,6)
다른사람의 풀이
def solution(s): return s.isdigit() and len(s) in (4,6)