BoostCourse
-
Module and ProjectBoostCourse 2023. 1. 2. 14:35
같은 directory 폴더 안에 있는 .py 파일을 import로 불러서 그 안의 코드를 사용할 수 있다. 1. 별칭(Alias) 설정하기 ex. import fah_converter as fah 2. 모듈에서 특정 함수 또는 클래스만 호출하기 ex. from fah_converter import covert_c_to_f 3. 모듈에서 모든 함수 또는 클래스를 호출하기 ex. from fah_converter import * Built in Moudle random time urllib.request if __name__ == "__main__" In short: It allows you to execute code when the file runs as a script but not when it's..
-
Python Object Oriented ProgrammingBoostCourse 2022. 12. 31. 01:53
오늘은 BoostCourse에서 객체 지향 프로그래밍에 대해 배웠다. From TEAMLAB director 최성철 특정 기능을 가지는 프로그램을 만들기 위해서, 시작부터 끝까지 순서대로 모든 기능을 구현하는 것은 비효율적일 수 있다. 이때, 효율적으로 기능을 구현하기 위해서 OOP를 사용한다. 먼저 OOP는 설계도에 해당하는 클래스와, 구현체인 인스턴스로 나눌 수 있다. 설계도: 클래스(class), 붕어빵의 틀 구현체: 인스턴스(instance), 붕어빵 class SoccerPlayer(object): def __init__(self, name, position, back_number): self.name = name self.position = position self.back_number = b..
-
데이터 구조(Data Structure)BoostCourse 2022. 12. 29. 18:45
기본 데이터 구조로는 다음과 같은 구조가 있다. 1. 스택과 큐(stack & queue with list) 2. 튜플과 집합(tuple & set) 3. 사전(dictionary) 4. Collection 모듈 스택: Last In First Out (LIFO) push - list.append(sth) pop - list.pop() ex) Delivery System 큐: First In First Out (FIFO) enqueue - list.append(sth) dequeue - list.pop(0) 튜플: Unchageable ex) 학번, 이름, 우편번호 등 ** t = (1,) - 값이 하나일 경우 , 필요 집합: 중복 불허, 순서 없음 s.add() s.remove() - 지우려는 elem..