어쨌든 해내는 코딩 일기

  • 홈
  • Java script
  • React
  • Python
  • Html 및 Css
  • 방명록
  • 태그

python class 2

[파이썬] 예외처리(try, except, ValueError, ZeroDivision, raise, __str__, break, finally)

Try 와 except로 예외처리try: print("나누기 전용 계산기입니다.") num1=int(input("첫 번째 숫자를 입력하세요:")) num2=int(input("두 번째 숫자를 입력하세요:")) print("{0}/{1}={2}".format(num1,num2,int(num1/num2)))except ValueError: print("에러! 잘못된 값을 입력하였습니다.") except ZeroDivisionError as err: print(err)  value error :값이 잘못 입력 됐을 때zerodivision error: 0으로 나누는 문제가 발생했을 때Terminal>>나누기 전용 계산기입니다. 첫 번째 숫자를 입력하세요:3 두 번째 숫자를 입력..

Python 2024.11.10

[파이썬] 클래스class Ⅲ ( pass, super )

pass (일단 넘어가기, 함수에서 break 같은 것)- 건물 유닛으로 예시1#일반 유닛class unit: def __init__(self,name,hp,speed): self.name=name self.hp=hp self.speed=speed def move(self,location): print("[지상 유닛 이동]") print("{0}:{1} 방향으로 이동합니다. [속도{2}]"\ .format(self.name,location,self.speed)) #건물 유닛class buildingunit(unit): def __init__(self,name,hp,locat..

Python 2024.11.09
이전
1
다음
더보기
프로필사진

어쨌든 해내는 코딩 일기

20대 후반 비전공자의 웹 개발 독학 이야기

  • 분류 전체보기 (36)
    • Java script (7)
    • React (10)
    • Python (11)
    • Html & Css (8)
    • 프로젝트 아카이브 (0)

Tag

CSS, 리액트, 프로그래밍독학, 웹개발, javascript, programming, 파이썬, 티스토리챌린지, react, 자바스크립트, 웹디자인, 오블완, Python, 파이썬클래스, python class, Github, 개발자, 파이썬독학, for함수, HTML,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

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

티스토리툴바