Exemple #1
0
"""
날짜: 2020/06/24
이름 :강래구
내용 : 클래스  교재 p183
"""

#객체생성
from Ch05.sub1.Account import Account
from Ch05.sub2.Smartphone import Smartphone

kb = Account('국민은행', '101-11-1153-1532', '김유신', 10000)
wb = Account('우리은행', '101-1153-1532-01', '김춘추', 20000)

kb.deposit(30000)
kb.withdraw(15000)
kb.show()

wb.deposit(10000)
wb.withdraw(5000)
wb.show()

#클래스 상속
iphone = Smartphone('A7', '4GB', '128GB', '아이폰7', '010-2688-8888')
iphone.call()
iphone.calc()
iphone.internet()
iphone.show()
Exemple #2
0
"""
    날짜 : 2020/06/24
    이름 : 권기민
    내용 : 클래스 교재 p183
"""

# 객체 생성
from Ch05.sub1.Account import Account
from Ch05.sub2.Smartphone import Smartphone

kb = Account('국민은행', '101-12-1111', '김유신', 10000)
wr = Account('우리은행', '101-12-2222', '김춘추', 10000)

kb.deposit(30000)
kb.withdraw(5000)
kb.show()

wr.deposit(25000)
wr.withdraw(7000)
wr.show()

# 클래스 상속
iphone = Smartphone('A7', '4GB', '120GB', '아이폰7', '010-1234-1111')
iphone.call()
iphone.calc()
iphone.internet()
iphone.show()
Exemple #3
0
"""
날짜 : 2020/12/23
이름 : 김하린
내용 : 파이썬 클래스 실습하기
"""

from Ch05.sub1.Account import Account
from Ch05.sub1.Calc import Calc
from Ch05.sub1.StockAccount import StockAccount

# Account 객체 생성
kb = Account('국민은행', '101-12-1234', '김유신', 10000)
kb.deposit(20000)
kb.withdraw(5000)
kb.show()

wr = Account('우리은행', '101-11-1111', '장보고', 30000)
wr.deposit(20000)
wr.withdraw(7000)
wr.show()

# Calc 객체 생성
cal = Calc()
r1 = cal.plus(2, 3)
r2 = cal.minus(2, 3)
r3 = cal.multi(2, 3)
r4 = cal.div(4, 2)

print('r1 : ', r1)
print('r2 : ', r2)
print('r3 : ', r3)