1213. String

·2023년 5월 17일

SWEA

목록 보기
29/46

출처 : sw expert academy

T = 10 
# 여러개의 테스트 케이스가 주어지므로, 각각을 처리합니다.
for test_case in range(1, T + 1):
    n = int(input())
    strValue = str(input())
    s  = str(input())
    print('#'+str(test_case), s.count(strValue))

문자열 내장함수 - 문자개수세기 count()

  • 문자열의 해당 문자 개수를 반환
    ex) str.count('b')
profile
🐥

0개의 댓글