본문 바로가기

전체 글141

16. Inheritance in Python 1. Inheritance Inheritance in Python is a mechanism that allows one class to inherit the properties and methods of another class. This enables code reuse and extensibility. By default, all classes in Python inherit from a base class called object. Base Class (or Parent Class): The class from which inheritance is derived. Derived Class (or Child Class): The class that inherits properties and meth.. 2024. 3. 19.
16. 파이썬 상속 1. 상속 파이썬에서 상속은 한 클래스의 속성과 메서드를 다른 클래스에 전달하는 기능을 의미합니다. 상속을 사용하면 기존의 코드를 재사용하고 확장할 수 있습니다. 기본적으로 파이썬의 모든 클래스는 object라는 기본 클래스로부터 상속받습니다. 기본 클래스 (또는 부모 클래스) : 상속의 출발점이 되는 클래스입니다. 파생 클래스 (또는 자식 클래스) : 상속을 통해 속성과 메서드를 받는 클래스입니다. 2. 클래스 상속 시 생성자 호출 순서 파이썬에서 상속은 한 클래스의 속성과 메서드를 다른 클래스에 전달하는 기능을 의미합니다. 상속을 사용하면 기존의 코드를 재사용하고 확장할 수 있습니다. 기본적으로 파이썬의 모든 클래스는 object라는 기본 클래스로부터 상속받습니다. 자식 클래스(child class).. 2024. 3. 19.
15. Object-oriented programming and Class 1. Object-Oriented Programming (OOP) Object-Oriented Programming (OOP) is one of the important programming paradigms used for designing and implementing software. This paradigm divides the program into independent entities called "objects" and organizes the program through interactions among these objects. Noun: Variable Verb: Function Programming in this way constitutes object-oriented programm.. 2024. 3. 18.
15. 객체지향과 클래스&과제 1. 객체지향 프로그래밍 객체지향 프로그래밍(Object-Oriented Programming, OOP)은 소프트웨어를 설계하고 구현하는 데 사용되는 중요한 프로그래밍 패러다임 중 하나입니다. 이 패러다임은 프로그램을 "객체"라고 불리는 독립적인 개체로 나누고, 이러한 객체들 간의 상호작용을 통해 프로그램을 구성하는 개발 방법론입니다. 명사 : 변수 동사 : 함수 이걸 통해 프로그램을 짜는게 객체지향 프로그램입니다. 절차지향 프로그래밍 절차지향프로그래밍은 프로그램을 작성할 때 일련의 절차 또는 단계에 따라 코드를 구성하는 방식입니다. 이러한 단계나 절차들은 주로 함수나 서브루틴으로 나누어져 있으며, 각각의 함수는 특정한 작업을 수행합니다. 주로 '입력 - 처리 - 출력'의 순차적인 절차를 따르며, 코드를.. 2024. 3. 18.
14. Callbacks and Lambdas in Python 1. Callback Function A callback function is a function that is passed as an argument to another function and is executed when a certain event or condition occurs. Callback functions are commonly used in asynchronous operations or when you want to perform a specific action when a certain event occurs. 2. Lambda Function A lambda function is a special syntax in Python for creating simple anonymous.. 2024. 3. 18.
14. 콜백함수와 람다함수 1. 콜백함수(callback function) 콜백 함수는 다른 함수에 인자로 전달되어, 어떤 이벤트나 특정 조건에서 실행되게 되는 함수를 말합니다. 콜백 함수는 주로 비동기 작업이나 특정 이벤트 발생 시점에 어떤 동작을 수행할 때 사용됩니다. 2. 람다 함수(Lambda Funciont) 람다 함수는 파이썬에서 익명의 간단한 함수를 생성하기 위한 특별한 구문입니다. "익명의 함수"라는 것은 함수에 고유한 이름이 지정되지 않았음을 의미합니다. 람다 함수는 일반적인 함수(def를 사용하여 정의)와는 달리, 한 줄로 표현되는 짧고 간결한 함수를 생성할 때 주로 사용됩니다. arguments: 람다 함수에 전달되는 인자들입니다. expression: 반환할 표현식입니다. 이 표현식의 값이 람다 함수가 호출될.. 2024. 3. 18.