[프로그래머스] 문자열 다루기 기본

psy4072·2022년 10월 29일
0

Algorithm

목록 보기
10/23

내 답안

def solution(s):
	if (len(s) == 4) | (len(s) == 6):
    	return s.isdigit()

다른 사람 답안

def solution(s):
	if len(s) not in (4, 6):
    	return False
    try:
    	int(s)
        return True
    except:
    	return False
profile
Ⓓ🅰️🅣🄰 ♡♥︎

0개의 댓글