myfirst2021

OOP Learning Example by Veerapong Lobtum


Keywords
myfirst2021, Student, Uncle, Engineer, Veerapong, Lobtum
License
MIT
Install
pip install myfirst2021==0.3

Documentation

ตัวอย่างโปรแกรมสำหรับการเรียน OOP

วิธีติดตั้ง

เปิด CMD / Terminal

pip install myfirst2021

วิธีเล่น

เปิด IDLE ขึ้นมาแล้วพิมพ์...

from myfirst import Student,SpecialStudent

print('========2021,1 Jan========')
student0 =SpecialStudent('Mark','Bill Gate')
student0.AskEXP()
student0.ShowEXP()

student1 = Student('Albert') #Object
print(student1.name)
student1.Hello()
print('-----------')
student2 = Student('Steve')
print(student2.name)
student2.Hello()


print('========2021,2 Jan========')
print('--------ใครอยากเรียน coding บ้าง?----(10 xp)----')
student1.AddEXP(10)

print('========2021,3 Jan========')
student1.name = 'Albert Einstein'
print('ตอนนี้ exp ของแต่ละคนได้เท่าไหร่กันแล้ว')
print(student1.name,student1.exp)
print(student2.name,student2.exp)

print('========2021,4 Jan========')
for i in range(5):
	student2.Coding()
student0.ShowEXP()
student1.ShowEXP()
student2.ShowEXP()

พัฒนาโดย: วีรพงศ์ ลบตุ้ม FB: https://www.facebook.com/jamer55/