bestwish
Hong's Tistory
bestwish
전체 방문자
오늘
어제
  • 분류 전체보기 (32)
    • DevOps (21)
      • Django (15)
      • TIL (2)
      • Python (2)
      • Git (0)
      • Docker (1)
      • Infra (1)
    • Algorithm (3)
      • 백준문제 (3)
      • 이론 (0)
    • CS (6)
      • Data Structure (6)

인기 글

최근 글

hELLO · Designed By 정상우.
bestwish

Hong's Tistory

DevOps/Python

[Python] str count 함수

2022. 3. 25. 16:39

string.count(self, x, _start, _end)

  • _start, _end는 문자열 범위를 지정하고, 생략이 가능하며, 생략할 시 처음부터 끝까지 탐색한다.
  • 대소문자를 구분한다.
  • x에 문자 한개 또는 문자열로 입력이 가능하다.
a, b, c = map(int, input().split()) # 2 2 2

result = list(str(a * b * c)) # 8

for i in range(10):
  print(result.count(str(i)), end=' ') 

# 결과 0 0 0 0 0 0 0 0 1 0

 

'DevOps > Python' 카테고리의 다른 글

[Error]ModuleNotFoundError: No module named 'pip'  (0) 2022.11.05
    'DevOps/Python' 카테고리의 다른 글
    • [Error]ModuleNotFoundError: No module named 'pip'
    bestwish
    bestwish

    티스토리툴바