문자열 s의 길이가 4 혹은 6이고, 숫자로만 구성돼있는지 확인해주는 함수, solution을 완성하세요. 예를 들어 s가 "a234"이면 False를 리턴하고 "1234"라면 True를 리턴하면 됩니다.
def solution(s):
if len(s) != 4 and len(s) != 6:
return False
else:
if s.isdigit():
return True
else:
return False
type(x)
s.isdigit()
def alpha_string46(s):
return s.isdigit() and len(s) in [4,6]