Skip to content

Instantly share code, notes, and snippets.

@gothedistance
Created October 14, 2020 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gothedistance/f11929e803dc150dba3d8c13037bbf4b to your computer and use it in GitHub Desktop.
Save gothedistance/f11929e803dc150dba3d8c13037bbf4b to your computer and use it in GitHub Desktop.
オブジェクト指向メモ
class Human:
age = 0 # 年齢
firstname = 0 # 名前
lastname = 0 # 名字
bloodtype = '' # 血液型
# 抽象化して「Humanクラス」をここでは定義しました。
# この抽象化されたモデルから、イラストに該当する個別の人間を作ることが出来るようになります。
# イラストに合わせて変数名を定義しました
office_lady = Human() # OL風の女性
salaryman = Human() # サラリーマン風の男性
senior = Human() # おじいさん
child = Human() # お子様
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment