回答編集履歴

6

 

2022/11/13 12:19

投稿

退会済みユーザー
test CHANGED
@@ -14,5 +14,5 @@
14
14
  ```
15
15
  ---
16
16
 
17
- ※ または、pokemon_category をクラス変数として定義する方法もあるかもしれませんが、pokemon_categoryがインタンスごとに共通であるのかどうか、また、継承元の pokemon クラスで pokemon_category の値はどうあるべきなのかが質問には一切記載されていないため、割愛します
17
+ ※ または、pokemon_category をクラス変数として定義する方法もあるかもしれませんが、pokemon_categoryが各クラスごとに共通であるのかどうか、また、継承元の pokemon クラスで pokemon_category の値はどうあるべきなのかが質問には一切記載されていないため、割愛します
18
18
 

5

  

2022/11/13 12:14

投稿

退会済みユーザー
test CHANGED
@@ -12,6 +12,7 @@
12
12
 
13
13
 
14
14
  ```
15
+ ---
15
16
 
16
- ※ または、pokemon_category をクラス変数として定義する方法もあるかもしれませんが、pokemon_categoryがインスタンスごとに共通であるのかどうか、また、継承元の pokemon クラスで pokemon_category が必須であるか、その場合 pokemon_category の値はどうあるべきなのかが質問には一切記載されていないため、割愛します
17
+ ※ または、pokemon_category をクラス変数として定義する方法もあるかもしれませんが、pokemon_categoryがインスタンスごとに共通であるのかどうか、また、継承元の pokemon クラスで pokemon_category の値はどうあるべきなのかが質問には一切記載されていないため、割愛します
17
18
 

4

 

2022/11/13 12:13

投稿

退会済みユーザー
test CHANGED
@@ -1,6 +1,6 @@
1
1
  > 「pokemon_category」を子クラスにて"イーブイ"と定義したい
2
2
 
3
- 子クラスの `__init__` 内で pokemon_category の内容を指定し、それを親クラスの `__init__` の pokemon_category に渡します。
3
+ 1.子クラスの `__init__` 内で pokemon_category の内容を指定し、それを親クラスの `__init__` の pokemon_category に渡します。
4
4
 
5
5
  ```python
6
6
 
@@ -13,3 +13,5 @@
13
13
 
14
14
  ```
15
15
 
16
+ ※ または、pokemon_category をクラス変数として定義する方法もあるかもしれませんが、pokemon_categoryがインスタンスごとに共通であるのかどうか、また、継承元の pokemon クラスでも pokemon_category が必須であるのか、その場合 pokemon_category の値はどうあるべきなのかが質問には一切記載されていないため、割愛します
17
+

3

 

2022/11/13 12:06

投稿

退会済みユーザー
test CHANGED
@@ -1,6 +1,6 @@
1
1
  > 「pokemon_category」を子クラスにて"イーブイ"と定義したい
2
2
 
3
- 子クラスの __init__ 内で pokemon_category の内容を指定し、それを親クラスの __init__ の pokemon_category に渡します。
3
+ 子クラスの `__init__` 内で pokemon_category の内容を指定し、それを親クラスの `__init__` の pokemon_category に渡します。
4
4
 
5
5
  ```python
6
6
 

2

 

2022/11/13 12:03

投稿

退会済みユーザー
test CHANGED
@@ -1,6 +1,6 @@
1
1
  > 「pokemon_category」を子クラスにて"イーブイ"と定義したい
2
2
 
3
- 子クラスの__init__ 内で pokemon_category を指定し、それを親クラスの__init__に渡します。
3
+ 子クラスの __init__ 内で pokemon_category の内容を指定し、それを親クラスの __init__ の pokemon_category に渡します。
4
4
 
5
5
  ```python
6
6
 

1

 

2022/11/13 12:00

投稿

退会済みユーザー
test CHANGED
@@ -9,5 +9,7 @@
9
9
  def __init__(self, name, category, attribute, height, weight, propertys, hp, attack, defense, special_attack, special_defense, rapidity, skil1, skil2, skil3, skil4):
10
10
  pokemon_category = "イーブイ"
11
11
  super().__init__(name, pokemon_category, category, attribute, height, weight, propertys, hp, attack, defense, special_attack, special_defense, rapidity, skil1, skil2, skil3, skil4)
12
+
13
+
12
14
  ```
13
15