type()으로 자료형 확인하기 + 객체 개념
우선 JAVA 위주로 공부하다가 Python도 함께 공부하니 둘 다 객체지향 언어(Class 사용)라는 점에서 닮은 점이 많았다. class Coffee : pass print(type(3), ":3") print(type(4), ":4") print(type(3.14), ":3.14") print(type(3.15),"3.15") print(type(True),":True") print(type(False),":False") print(type("Hello"),":Hello") print(type([1,2,3,4]),": [1,2,3,4]") print(type(Coffee()), ":Coffee()") print(type(Coffee), ":Coffee") 실행 결과 :3 :4 :3.14 3.15 :..
2021.08.31