파이썬 알고리즘1 [프로그래머스] 문자열 다루기 기본, 파이썬 isdigit [해결]def solution(s): if len(s)==4 or len(s)==6: for ch in s: if ch'9': answer=False return answer else: answer=True else: answer=False[해결2]def solution(s): if len(s)==4 or len(s)==6: answer=s.isdigit() else: answer=False return answer + 알아두면 좋은str.isdigit() : 문자열이 숫자로만 이루어져있는지 확인할때 .. 2024. 6. 26. 이전 1 다음