programmers | Lv1. 문자열 다루기 기본 [Python]

yeonk·2022년 2월 16일
0

algorithm

목록 보기
24/88
post-thumbnail

💡 Python 3






🔗 문제

문자열 다루기 기본 [Link]






💻 코드

def solution(s):
    return (len(s) == 4 or len(s) == 6) and s.isdigit()






💥 다른 사람 코드

간결한 코드

def alpha_string46(s):
    return s.isdigit() and len(s) in (4, 6)

0개의 댓글