일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- 조합
- 코딩테스트
- hackerrank
- coding test
- Level2
- LeetCode
- programmers
- 파이썬
- level4
- 코딩
- itertools
- Growth hacking
- sql
- 완전탐색
- join
- Stack
- 코테
- 프로그래머스
- tableau
- lambda
- AARRR
- lv4
- time complexity
- mysql
- Queue
- import re
- coding
- python
- counter
- cte
Archives
- Today
- Total
목록lower() (1)
ror_coding
[Programmers] 문자열 내 p와 y의 개수 - 12916
.lower() 함수를 잘못 써서 정리한다! lower(s) 이렇게 써버렸다 ㅋㅋㅋ..ㅎ Question 대문자와 소문자가 섞여있는 문자열 s가 주어집니다. s에 'p'의 개수와 'y'의 개수를 비교해 같으면 True, 다르면 False를 return 하는 solution를 완성하세요. 'p', 'y' 모두 하나도 없는 경우는 항상 True를 리턴합니다. 단, 개수를 비교할 때 대문자와 소문자는 구별하지 않습니다. 예를 들어 s가 "pPoooyY"면 true를 return하고 "Pyy"라면 false를 return합니다. Point .lower()을 사용해서 대소문자 구별 X Code def solution(s): s = s.lower() return True if s.count('p') ..
Coding Test/Python
2024. 9. 28. 15:27