Python🍍 7

Error and Exception Handling🥑

try문으로 예외가 발생할 가능성이 있는 코드를 작성하고, except문으로 예외 거르기! else문은 예외가 발생하지 않는 경우 출력되며, finally는 예외 발생여부와 관련없이 항상 출력된다! Code Example🙄 : try: print('10'+10); except IOError: print('You have an input/output error') except TypeError: print('You are using the wrong data types!') except: #모든 error print("Hey you got an error!") else: #예외가 실행되지 않는 경우 print("Else Bock run") finally: #항상 실행 print("Finally will a..

Python🍍 2022.06.30

Python Data Types💥

파이썬의 데이터 타입은 크게 6가지 카테고리로 분류될 수 있다. Numeric Types : int, float, complex Sequence Types : str, list, tuple Mapping Typye : dict Set Type : set Boolean Type : bool Binary Type : bytes, bytearray, memoryview [Code Examples]😁 : Numeric Types : int, float, complex # 1.Numeric Types : int(정수), float(실수), complex(복소수) x=3; y=3.5; z=2+2j; print(type(x)); # print(type(y)); # print(type(z)) # Sequenc Type..

Python🍍 2022.06.25