본문 바로가기

Daily Develope

검색하기
Daily Develope
프로필사진 noggame

  • 분류 전체보기 (112) N
    • Develope (53)
      • Python (31)
      • Web (18)
      • ETC (4)
    • AI (16)
    • DB (6)
    • MicroService (7)
      • Docker (6)
      • Kubernetes (1)
    • OS (15)
      • Linux (10)
      • Windows (1)
      • Mac (4)
    • Git (7)
    • Algorithm (1)
    • Favorite (4) N
      • 책갈피 (4) N
      • Music (0)
Guestbook
Notice
  • migration 중입니다...
Recent Posts
Recent Comments
Link
«   2025/06   »
일 월 화 수 목 금 토
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags
  • pandas
  • file
  • Laravel
  • list
  • format
  • Paper
  • git
  • evaluation
  • Package
  • GitLab
  • PostgreSQL
  • Linux
  • Database
  • 책갈피
  • Container
  • Flask
  • Converting
  • DB
  • Windows
  • Mac
  • KAKAO
  • Python
  • AI
  • TORCH
  • pytorch
  • docker
  • enV
  • numpy
  • judge
  • LLM
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록setter (1)

Daily Develope

[Python] 클래스 속성의 getter & setter 정의

방법 1. 내장 property method 클래스의 속성값에 대한 getter, setter, destructor 동작을 method로 정의하고, 내장함수인 property를 사용해 해당하는 속성과 연결시켜 사용. 샘플코드 # Python program showing a use of property() function class Geeks: def __init__(self): self._age = 0 # function to get value of _age def get_age(self): print("getter method called") return self._age # function to set value of _age def set_age(self, a): print("setter metho..

Develope/Python 2023. 9. 11. 14:50
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바