일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- sql연습
- 주피터노트북
- 주피터노트북맷플롯립
- python알고리즘
- 파이썬알고리즘
- python수업
- 주피터노트북데이터분석
- 주피터노트북판다스
- 판다스그래프
- python데이터분석
- 파이썬데이터분석
- 수업기록
- 맷플롯립
- SQLSCOTT
- 데이터분석시각화
- 파이썬
- SQL
- 파이썬시각화
- sql따라하기
- sql연습하기
- 파이썬데이터분석주피터노트북
- 파이썬수업
- 판다스데이터분석
- 주피터노트북그래프
- SQL수업
- Python
- 팀플기록
- 파이썬차트
- matplotlib
- 파이썬크롤링
- Today
- Total
목록python클래스 (3)
IT_developers

오버라이딩 : 부모클래스가 가지고 있는 메소드 재정의 class Parent: def func1(self): print("Parent func1()") def func2(self): print("Parent func2()") class Child(Parent): def func1(self): print("Child func1()") def func3(self): print("Child func2()") parent, child = Parent(), Child() parent.func1() child.func1() parent.func2() child.func2() child.func3() # Car ==> upspeed 오버라이딩 class Car: speed = 0 def up_speed(self, v..

# 클래스 변수와 인스턴스 변수 차이 class Car: """ UserInfo class Author : 홍길동 Date : 2022-05-26 Description : 클래스 작성법 """ # 클래스 변수 car_count = 0 # 인자를 받는 생성자 def __init__(self, count, color, speed) -> None: self.color = color self.speed = speed Car.car_count += count def upSpeed(self, value): self.speed += value def downSpeed(self, value): self.speed -= value # 객체 삭제 def __del__(self): Car.car_count -= 1 # 객체..

파이썬 클래스 클래스를 꼭 필요로 하진않음. 클래스를 만들어 놓으면 계속 불러서 쓸 수 있음 안할 땐 변수로 가능 클래스 사용하지 않고 학생 3명의 정보 변수 사용해서 학생 3명 입력. 변수명이 중복 불가. # 학생 1 student_name1 = "Kim" student_number_1 = 1 student_grade_1 = 1 student_detail_1 = [{"gender": "male"}, {"score1": 97}, {"score2": 88}] # 학생 2 student_name2 = "Park" student_number_2 = 2 student_grade_2 = 2 student_detail_2 = [{"gender": "female"}, {"score1": 87}, {"score2": ..