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 |
---|