2개 중 최대
https://www.codetree.ai/missions/4/problems/max-of-two-nums?&utm_source=clipboard&utm_medium=text
c = input()
new_c = c.split(" ")
a = int(new_c[0])
b = int(new_c[1])
d = a if a > b else b
print(d)
삼항연산자
https://www.codetree.ai/missions/4/problems/ternary-operator?&utm_source=clipboard&utm_medium=text
s = int(input())
t = "pass" if s == 100 else "failure"
print(t)
삼항연산자 2
https://www.codetree.ai/missions/4/problems/ternary-operator-2?&utm_source=clipboard&utm_medium=text
a = int(input())
i = "t" if a == 1 else "f"
print(i)
'코딩테스트 > 프로그래밍 기초 | 조건문' 카테고리의 다른 글
[코드트리] if if 조건문 (0) | 2024.09.10 |
---|---|
[코드트리] if elif elif else 조건문 (0) | 2024.09.10 |
[코드트리] if elif else 조건문 (1) | 2024.09.02 |
[코드트리] if else 조건문 (0) | 2024.08.27 |
[코드트리] if 조건문 (0) | 2024.08.26 |