Latest web development tutorials

파이썬 isdigit에 () 메소드

파이썬 문자열 파이썬 문자열


기술

숫자로만 구성된 문자열을 감지하는 파이썬 isdigit에 () 방법입니다.

문법

isdigit에 () 메서드 구문 :

str.isdigit()

매개 변수

  • 없음.

반환 값

문자열은 True, 그렇지 않으면 거짓 숫자 만 반환이 포함 된 경우.

다음 예 isdigit에 () 방법의 예를 나타낸다 :

#!/usr/bin/python

str = "123456";  # Only digit in this string
print str.isdigit();

str = "this is string example....wow!!!";
print str.isdigit();

다음, 상기 출력 결과의 예 :

True
False

파이썬 문자열 파이썬 문자열