코딩공부

  • 홈
  • 태그
  • 방명록

pass 1

[Python] Class

1. 클래스 선언 (Declaration) class : def __init__(): 생성자 __init__(): 생성자. self제외 모든 파라미터를 self.로 재정의해줘야 함. 멤버변수: self.name (클래스 내에 정의된 변수) class Unit: def __init__(self, name, hp, speed): self.name = name self.hp = hp self.speed = speed print("{0} 유닛이 생성되었습니다".format(name)) def move(self, location): print("[지상유닛 이동]") print("{0} : {1} 방향으로 이동합니다. [속도 : {2}]" \ .format(self.name, location, self.speed)..

Self-study/Python 2023.12.29
이전
1
다음
더보기
프로필사진

코딩공부

  • 분류 전체보기 (41)
    • Self-study (38)
      • HTML (0)
      • CSS (0)
      • Javascript (12)
      • 자바 (5)
      • Python (11)
      • React (6)
      • C언어 (1)
      • Kotlin (2)
      • 기타 (1)
    • Leetcode (3)
      • alogorithm (0)

Tag

coding, python, 초보개발, 리트코드, 지역변수, 자바스크립트, 파이썬, 외장함수, 코딩, 자바의정석, 자바스크립, 파이썬 기초, 지수표기법, 자바, mutability, 객체지향, 변수, 함수, leetcode, 코드잇,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/10   »
일 월 화 수 목 금 토
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 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바