回答編集履歴
2
プログラム変更
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
class date:
|
8
8
|
|
9
|
-
def init(self,aa,bb,cc):
|
9
|
+
def __init__(self,aa,bb,cc):
|
10
10
|
|
11
11
|
self.a=aa
|
12
12
|
|
@@ -18,14 +18,8 @@
|
|
18
18
|
|
19
19
|
date1 = date(10,20,30)
|
20
20
|
|
21
|
-
|
21
|
+
x = input()
|
22
22
|
|
23
|
-
print(date1.a)
|
24
|
-
|
25
|
-
print(date1.b)
|
26
|
-
|
27
|
-
print(date1.c)
|
28
|
-
|
29
|
-
print(date1
|
23
|
+
print(getattr(date1, x))
|
30
24
|
|
31
25
|
```
|
1
修正
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
こう
|
1
|
+
こうですか?
|
2
2
|
|
3
3
|
|
4
4
|
|
@@ -18,6 +18,14 @@
|
|
18
18
|
|
19
19
|
date1 = date(10,20,30)
|
20
20
|
|
21
|
-
date1.x=input()
|
21
|
+
date1.x = input()
|
22
|
+
|
23
|
+
print(date1.a)
|
24
|
+
|
25
|
+
print(date1.b)
|
26
|
+
|
27
|
+
print(date1.c)
|
28
|
+
|
29
|
+
print(date1.x)
|
22
30
|
|
23
31
|
```
|