본문 바로가기
Algorithm/Softeer

[Softeer / Level2] 8단 변속기

by 개복취 2023. 10. 2.

https://www.softeer.ai/practice/info.do?idx=1&eid=408 

 

Softeer

연습문제를 담을 Set을 선택해주세요. 취소 확인

www.softeer.ai

 


 

 

간단한 리스트 비교문제이다.

조건에 알맞게 문자열을 출력해주면 끝

 

<내 코드>

import sys

input = sys.stdin.readline

S = list(map(int, input().split()))

if S == [1, 2, 3, 4, 5, 6, 7, 8]:
    print("ascending")
elif S == [8, 7, 6, 5, 4, 3, 2, 1]:
    print("descending")
else:
    print("mixed")