-
Python_if_else_and_or연습코딩Coding/Mojo★Python파이썬_연습 2020. 6. 26. 01:12728x90
def age_check(age): print(f"you are {age}") if age < 18: print("you cant drink") elif age == 18: print("you are new to this!") elif age > 20 and age < 25: print("you are still kind of young") else: print("enjoy your drink") age_check(29)
결과 print 18, 23, 29로 바꿔가며 출력
https://nomadcoders.co/python-for-beginners
반응형'코딩Coding > Mojo★Python파이썬_연습' 카테고리의 다른 글
Python 패토리얼 예문 연습해보자 factorial (0) 2022.02.14 Python_if_elif_else예제 (0) 2020.06.23 Python_Fibonacci_Sequence(피보나치 수열)연습 (0) 2020.06.23 Python_계산기초급 (0) 2020.06.21 Python_문자열 포맷팅_positional argument, keyword argument) (0) 2020.06.21 나만의 Function만들기(def로 정의함_Function_Syntax)2 (0) 2020.06.20 나만의 Function만들기(def로 정의함_Function_Syntax) (0) 2020.06.19 Python_Append_reverse연습 (0) 2020.06.19