[Python] 한 줄로 조건문 쓰기
in DATA on Data, Python_d, Python, One-line-condition, 한줄조건문
한 줄로 조건문 쓰기
age = 20
# One-liner if-else statement
age_group = "Minor" if age < 18 else "Adult"
print(age_group)
in DATA on Data, Python_d, Python, One-line-condition, 한줄조건문
age = 20
# One-liner if-else statement
age_group = "Minor" if age < 18 else "Adult"
print(age_group)