YUYANE

Python / 조건문 본문

Programming Languages/PYTHON

Python / 조건문

YUYA 2020. 12. 16. 13:40

if-else문

def plus(a,b):
	if type(b) is str:
    	return None
    else :
    	return a+b

 

Boolean Operation

def age_check(age):
	print(f"you are {age}")
    if age < 18:
    	print("You can't 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(18)

 

'Programming Languages > PYTHON' 카테고리의 다른 글

Python/ default argument로 None을 주자  (0) 2020.12.16
Python / 반복문  (0) 2020.12.16
Python/ function  (0) 2020.12.15
Python/ Functions  (0) 2020.12.14
Python/ Sequence Type (list, dictionary)  (0) 2020.12.14
Comments