質問するログイン新規登録

質問編集履歴

1

状況の修正

2021/05/05 14:08

投稿

yyjfou
yyjfou

スコア35

title CHANGED
File without changes
body CHANGED
@@ -7,14 +7,14 @@
7
7
  y = 3
8
8
  z = 4
9
9
 
10
- def __init__(self):
10
+  def __init__(self):
11
- self.__x = 2
11
+   self.__x = 2
12
12
 
13
- def getx(self):
13
+  def getx(self):
14
- return self.__x
14
+   return self.__x
15
15
 
16
- def setx(self, val):
16
+  def setx(self, val):
17
- print "x is read only"
17
+   print "x is read only"
18
18
  ```
19
19
  と言うコードが出てきますが、self.__x はなぜアンダースコアが2つ連なっているのでしょうか?
20
20