isdecimal (1) 썸네일형 리스트형 [python] 코딩테스트 대비 - 문자열에서 숫자만 추출 문제) 답안코드) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import sys #sys.stdin=open("input.txt", "r") s=input() res=0#숫자만 추출된 결과 for x in s: if x.isdecimal():#x가 0~9숫자인지 판별해주는 함수. res=res*10+int(x)#숫자화 print(res) cnt=0 for i in range(1, res+1):#약수 갯수 계산 if res%i==0: cnt+=1 print(cnt) Colored by Color Scripter cs 이전 1 다음