[백준 1427 파이썬] 소트인사이드

일단 해볼게·2022년 11월 1일
0

백준

목록 보기
39/132

https://www.acmicpc.net/problem/1427

input1 = input()

lst = []

# 리스트에 값을 저장
for i in input1:
    lst.append(i)

# reverse = True  내림차순
lst.sort(reverse=True)

# 리스트 출력
for i in lst:
    print(i, end='')

sort는 원본을 정렬
sorted는 원본은 그대로 두고 정렬된 값만 출력

profile
시도하고 More Do하는 백엔드 개발자입니다.

0개의 댓글