반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- itertools
- nest swagger
- Nest.js
- Nest
- 프로그래머스 파이썬
- SAA-C03
- 프로그래머스파이썬
- nest swagger 데코레이터
- 파이썬 math 라이브러리
- 파이썬 정렬
- aws자격증가이드
- 파이썬 프로그래머스
- 파이썬 최소공배수
- examtopics
- 파이썬문자열함수
- aws
- 프로그래머스
- PHP8
- Python
- python sorted
- SAA자격증
- 프로그래머스 파이썬 문제풀이
- EC2란
- 파이썬
- SAA
- swagger 데코레이터
- 파이썬 문자열 함수
- 프로그래머스파이썬연습문제
- 파이썬 sorted
- 파이썬조합
Archives
- Today
- Total
사진찍는 개발자📸👩💻
[프로그래머스/파이썬] 문자열 정렬하기(1) 본문
반응형
SMALL
def solution(my_string):
answer = list()
for i in my_string:
if (i.isdecimal()):
answer.append(int(i))
return sorted(answer)
string.isdecimal() 함수를 사용하여 숫자인지 판별
answer 리스트에 자료형을 int로 바꿔서 append
sorted 함수를 사용하여 answer 정렬하여 리턴
반응형
LIST
'develop > Python' 카테고리의 다른 글
[프로그래머스/파이썬] 직각삼각형 출력하기 (0) | 2023.02.24 |
---|---|
[파이썬/Python] 자료형 판별 함수 (1) | 2023.02.24 |
[파이썬/Python] 문자열 관련 함수 (0) | 2023.02.24 |
[프로그래머스/파이썬] 암호 해독 (0) | 2023.02.24 |
[프로그래머스/파이썬] 대문자와 소문자 (0) | 2023.02.23 |