본문 바로가기
문제풀이/Programmers

[프로그래머스💯] 코딩테스트 연습 > 연습문제 > 문자열 내 p와 y의 개수

by 서상혁 2020. 3. 13.

<프로그래머스 문제풀이>

<출처 : 프로그래머스(Programmers)>

 


해답)

def solution(s):
    return True if s.count('p')+s.count('P') == s.count('y')+s.count('Y') else False

 

풀이)

이건 솔직히 설명따윈 필요없다

 

 

* 이 문제 및 로고의 저작권은 Programmers에 있습니다.

출처: 프로그래머스 코딩 테스트 연습, https://programmers.co.kr/learn/challenges

728x90

댓글