{"id":1055,"date":"2018-08-28T16:38:38","date_gmt":"2018-08-28T07:38:38","guid":{"rendered":"https:\/\/python-introduction.com\/?p=1055"},"modified":"2018-08-28T16:38:38","modified_gmt":"2018-08-28T07:38:38","slug":"%e3%80%90python%e5%85%a5%e9%96%80%e3%80%91%e3%82%af%e3%83%a9%e3%82%b9%e3%81%ae%e7%b6%99%e6%89%bf%e3%81%a8%e3%81%af%ef%bc%9f%e3%81%a9%e3%82%93%e3%81%aa%e3%81%93%e3%81%a8%e3%81%8c%e3%81%a7%e3%81%8d","status":"publish","type":"post","link":"https:\/\/python-introduction.com\/?p=1055","title":{"rendered":"\u3010Python\u5165\u9580\u3011\u30af\u30e9\u30b9\u306e\u7d99\u627f\u3068\u306f\uff1f\u3069\u3093\u306a\u3053\u3068\u304c\u3067\u304d\u308b\u306e\uff1f"},"content":{"rendered":"<p>\u524d\u56de\u306f\u30af\u30e9\u30b9\u5909\u6570\u3068\u30af\u30e9\u30b9\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002<br \/>\n\u3082\u3057\u524d\u56de\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u3067\u306a\u3044\u65b9\u306f<br \/>\n\u5148\u306b\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=1043\" target=\"blank\">\u3010Python\u3011\u30af\u30e9\u30b9\u5909\u6570\u3068\u30af\u30e9\u30b9\u30e1\u30bd\u30c3\u30c9\u306e\u9055\u3044<\/a><\/p>\n<p>\u4eca\u56de\u306f\u30af\u30e9\u30b9\u306e\u7d99\u627f\u3068\u306f\u3069\u3046\u3044\u3046\u3053\u3068\u306a\u306e\u304b\u3001<br \/>\n\u305d\u308c\u3068\u30af\u30e9\u30b9\u306e\u7d99\u627f\u306e\u7279\u5fb4\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h2>\u3010Python\u5165\u9580\u3011\u30af\u30e9\u30b9\u306e\u7d99\u627f\u3068\u306f\uff1f<\/h2>\n<p>\u30af\u30e9\u30b9\u306e\u7d99\u627f\u3068\u306f\u4f55\u304b\u3001\u7406\u89e3\u3059\u308b\u305f\u3081\u306b<br \/>\n\u307e\u305a\u306f\u4f8b\u984c\u3092\u4e00\u7dd2\u306b\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1 \u30af\u30e9\u30b9\u306e\u7d99\u627f\r\n\r\nclass Animal: #\u3053\u3053\u306f\u30af\u30e9\u30b9\r\n   dog = 'shibainu'\r\n   \r\n   def hoeru(self):\r\n    print('wanwan!')\r\n\r\nanimal = Animal()\r\nprint(animal.dog)\r\nanimal.hoeru()<\/pre>\n<p>\u4f8b\u984c1\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u306d\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">class Animal: #\u3053\u3053\u306f\u30af\u30e9\u30b9<\/pre>\n<p>\u307e\u305a\u3001Animal\u3068\u3044\u3046\u30af\u30e9\u30b9\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089<br \/>\ndog = &#8216;shibainu&#8217;<br \/>\n\u30af\u30e9\u30b9\u5909\u6570\u300edog\u300f\u3067\u3059\u3002<\/p>\n<p>\u30af\u30e9\u30b9\u5909\u6570\u306f\u30af\u30e9\u30b9\u306e\u4e2d\u306b\u8a18\u8ff0\u3055\u308c\u3066\u3044\u308b\u5909\u6570\u306e\u3053\u3068\u3067\u3059\u3002<br \/>\n\u30af\u30e9\u30b9\u5909\u6570\u306e\u8a73\u7d30\u306f\u3053\u3061\u3089\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=1043\" target=\"blank\">\u3010Python\u3011\u30af\u30e9\u30b9\u5909\u6570\u3068\u30af\u30e9\u30b9\u30e1\u30bd\u30c3\u30c9\u306e\u9055\u3044<\/a><\/p>\n<p>\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">   def hoeru(self):<\/pre>\n<p>hoeru\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=1025\" target=\"blank\">\u3010Python\u5165\u9580\u3011\u30e1\u30bd\u30c3\u30c9\u3068\u306f\uff1f\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059<\/a><\/p>\n<p>\u6b21\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">animal = Animal()\r\nprint(animal.dog)\r\nanimal.hoeru()<\/pre>\n<p>Animal\u3068\u3044\u3046\u30af\u30e9\u30b9\u306b()\u3092\u3064\u3051\u308b\u3053\u3068\u3067<br \/>\n\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u304canimal\u3068\u3044\u3046\u5909\u6570\u306b\u4ee3\u5165\u3055\u308c<br \/>\ndog\u306e\u5024\u3092print\u6587\u306b\u3088\u3063\u3066\u8868\u793a\u3055\u305b\u3001<br \/>\nanimal\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068<br \/>\nshibainu<br \/>\nwanwan!<br \/>\n\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mesoyyjo827.jpg\" alt=\"\u30af\u30e9\u30b9\u306e\u7d99\u627f\" width=\"279\" height=\"256\" class=\"alignnone size-full wp-image-1060\" \/><\/p>\n<p>\u6b21\u306b\u4f8b\u984c2\u3067Animal\u3068\u3044\u3046\u30af\u30e9\u30b9\u3092\u7d99\u627f\u3055\u305b\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><span class=\"yellowbg\">\u30af\u30e9\u30b9\u306e\u7d99\u627f\u3068\u306f\u3001\u4f8b\u984c\u306e\u3088\u3046\u306bAnimal\u3068\u3044\u3063\u305f\u30af\u30e9\u30b9\u304c\u3059\u3067\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u3066<br \/>\n\u305d\u306eAnimal\u306a\u3069\u304a\u30af\u30e9\u30b9\u3092\u30d9\u30fc\u30b9\u306b\u3057\u3066<br \/>\n\u65b0\u305f\u306a\u30af\u30e9\u30b9\u3078\u3068\u5f15\u304d\u7d99\u3044\u3067\u3044\u304f\u3053\u3068<\/span>\u3092\u3044\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u4f8b\u984c2\u3092\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c2\u3000\u30af\u30e9\u30b9\u306e\u7d99\u627f\r\n\r\nclass Cat(Animal) :#\u7d99\u627f\u5f8c\u306e\u30af\u30e9\u30b9\uff08\u7d99\u627f\u524d\u306e\u30af\u30e9\u30b9\uff09\r\n    nakigoe = '\u82e6\u60c5\u304c\u304d\u3066\u3044\u307e\u3059\u3088'\r\n    def urusai(self):\r\n        print('\u8fd1\u96a3\u4f4f\u6c11\u304b\u3089' + self.nakigoe + '\u3002')\r\n\r\ncat = Cat()\r\nprint(cat.dog)\r\ncat.hoeru()\r\n\r\nprint(cat.nakigoe)\r\ncat.urusai()<\/pre>\n<p>\u4f8b\u984c2\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">class Cat(Animal) :#\u7d99\u627f\u5f8c\u306e\u30af\u30e9\u30b9\uff08\u7d99\u627f\u524d\u306e\u30af\u30e9\u30b9\uff09<\/pre>\n<p>Cat(Animal)\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u306d\u3002<br \/>\n\u3053\u308c\u306fCat\u306f\u7d99\u627f\u5f8c\u306e\u30af\u30e9\u30b9\u3067\u3059\u3002<br \/>\n\uff08\uff09\u5185\u306eAnimal\u306f\u4f8b\u984c1\u3067\u4f7f\u7528\u3057\u305f\u5143\u306e\u30af\u30e9\u30b9\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u30af\u30e9\u30b9\u306e\u7d99\u627f\u304c\u884c\u308f\u308c\u305f\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">class Cat(Animal) :#\u7d99\u627f\u5f8c\u306e\u30af\u30e9\u30b9\uff08\u7d99\u627f\u524d\u306e\u30af\u30e9\u30b9\uff09\r\n    nakigoe = '\u82e6\u60c5\u304c\u304d\u3066\u3044\u307e\u3059\u3088'\r\n    def urusai(self):\r\n        print('\u8fd1\u96a3\u4f4f\u6c11\u304b\u3089' + self.nakigoe + '\u3002')<\/pre>\n<p>\u7d99\u627f\u3057\u305f\u65b0\u3057\u3044Cat\u30af\u30e9\u30b9\u306b\u306f<br \/>\nnakigoe\u3068\u3044\u3046\u30af\u30e9\u30b9\u5909\u6570\u3068urusai\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u304c<br \/>\n\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>urusai\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u306f<br \/>\n\u300e\u8fd1\u96a3\u4f4f\u6c11\u304b\u3089\u82e6\u60c5\u304c\u304d\u3066\u3044\u307e\u3059\u3088\u3002\u300f\u3068\u3044\u3046\u6587\u7ae0\u304c<br \/>\n\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\u8fd1\u96a3\u4f4f\u6c11\u304b\u3089' + self.nakigoe + '\u3002'<\/pre>\n<p>\u306f\u6587\u5b57\u5217\u306e\u7d50\u5408\u3067\u3059\u3002<\/p>\n<p>\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=581\" target=\"blank\">\u3010Python\u3011\u6587\u5b57\u5217\u3092\u7d50\u5408\u30fb\u62bd\u51fa\u3057\u305f\u308a\u7e70\u308a\u8fd4\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n<p>\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">cat = Cat()<\/pre>\n<p>Cat\u3068\u3044\u3046\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3057<br \/>\ncat\u3068\u3044\u3046\u5909\u6570\u306b\u4ee3\u5165\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=416\" target=\"blank\">\u3010Python\u5165\u9580\u3011\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a><\/p>\n<p>\u6b21\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">print(cat.dog)\r\ncat.hoeru()<\/pre>\n<p>\u7d99\u627f\u5143\u306e\u5909\u6570\u3067\u3042\u308bdog\u3092\u8868\u793a\u3055\u305b<br \/>\n\u7d99\u627f\u524d\u306e\u30e1\u30bd\u30c3\u30c9\uff08hoeru)\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">print(cat.nakigoe)\r\ncat.urusai()<\/pre>\n<p>\u65b0\u3057\u304f\u8ffd\u52a0\u3057\u305f\u30af\u30e9\u30b9\u5909\u6570\uff08nakigoe)\u3068<br \/>\n\u65b0\u3057\u304f\u8ffd\u52a0\u3057\u305f\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068<br \/>\nshibainu<br \/>\nwanwan!<br \/>\n\u82e6\u60c5\u304c\u304d\u3066\u3044\u307e\u3059\u3088<br \/>\n\u8fd1\u96a3\u4f4f\u6c11\u304b\u3089\u82e6\u60c5\u304c\u304d\u3066\u3044\u307e\u3059\u3088\u3002<br \/>\n\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mesoddu827.jpg\" alt=\"\u30af\u30e9\u30b9\u306e\u7d99\u627f\" width=\"404\" height=\"340\" class=\"alignnone size-full wp-image-1063\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mesoddu827.jpg 404w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mesoddu827-300x252.jpg 300w\" sizes=\"(max-width: 404px) 100vw, 404px\" \/><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u7d99\u627f\u524d\u306e\u6587\u5b57\u5217<br \/>\nshibainu\u3001wanwan!\u304c\u8868\u793a\u3055\u308c<br \/>\n\u65b0\u305f\u306a\u6587\u5b57\u5217\uff08\u82e6\u60c5\u304c\u304d\u3066\u3044\u307e\u3059\u3088<br \/>\n\u8fd1\u96a3\u4f4f\u6c11\u304b\u3089\u82e6\u60c5\u304c\u304d\u3066\u3044\u307e\u3059\u3088\u3002\uff09\u3082\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<h2>\u3010Python\u5165\u9580\u3011\u30af\u30e9\u30b9\u7d99\u627f\u306e\u7279\u5fb4<\/h2>\n<p>\u4f8b\u984c2\u3067\u308f\u304b\u3063\u3066\u3044\u305f\u3060\u3051\u305f\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u30af\u30e9\u30b9\u306e\u7d99\u627f\u3092\u884c\u3046\u3053\u3068\u3067\u3001\u5143\u306e\u30af\u30e9\u30b9\u304b\u3089<br \/>\n\u3044\u308d\u3093\u306a\u30af\u30e9\u30b9\u3092\u3069\u3093\u3069\u3093\u3068\u4f5c\u3063\u3066\u3044\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3093\u3067\u3059\u3002<\/p>\n<p>\u30af\u30e9\u30b9\u306e\u7d99\u627f\u3092\u884c\u3046\u3053\u3068\u3067<br \/>\n\u65e2\u5b58\u306e\u30af\u30e9\u30b9\u3092\u3001\u3082\u3063\u3068\u4f7f\u3044\u3084\u3059\u3044\u3082\u306e\u306b<br \/>\n\u4f5c\u308a\u304b\u3048\u3066\u3044\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089\u3001\u30af\u30e9\u30b9\u306e\u7d99\u627f\u3092\u884c\u3063\u3066\u3082<br \/>\n\u5143\u306e\u30af\u30e9\u30b9\u3067\u4f7f\u3063\u305f\u5909\u6570\u3084\u30e1\u30bd\u30c3\u30c9\u3092<br \/>\n\u305d\u306e\u307e\u307e\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u65b0\u3057\u304f\u30af\u30e9\u30b9\u3084\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u3093\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067\u30af\u30e9\u30b9\u306e\u7d99\u627f\u306b\u3064\u3044\u3066\u306e\u89e3\u8aac\u3092\u7d42\u308f\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u524d\u56de\u306f\u30af\u30e9\u30b9\u5909\u6570\u3068\u30af\u30e9\u30b9\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002 \u3082\u3057\u524d\u56de\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u3067\u306a\u3044\u65b9\u306f \u5148\u306b\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 \u21d2\u3010Python\u3011\u30af\u30e9\u30b9\u5909\u6570\u3068\u30af\u30e9\u30b9\u30e1\u30bd\u30c3\u30c9\u306e\u9055\u3044 \u4eca\u56de\u306f\u30af\u30e9\u30b9\u306e\u7d99\u627f\u3068\u306f\u3069\u3046\u3044\u3046\u3053\u3068\u306a\u306e\u304b\u3001 \u305d [&hellip;]","protected":false},"author":1,"featured_media":1058,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,95],"tags":[3,97,99],"_links":{"self":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1055"}],"collection":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1055"}],"version-history":[{"count":6,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1055\/revisions"}],"predecessor-version":[{"id":1064,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1055\/revisions\/1064"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/media\/1058"}],"wp:attachment":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}