回答編集履歴
4
プログラム修正
test
CHANGED
@@ -46,6 +46,8 @@
|
|
46
46
|
|
47
47
|
while True:
|
48
48
|
|
49
|
+
.... # 省略
|
50
|
+
|
49
51
|
if main_input == 0:
|
50
52
|
|
51
53
|
income_input = first()
|
3
プログラム修正
test
CHANGED
@@ -42,15 +42,19 @@
|
|
42
42
|
|
43
43
|
income_input = 0
|
44
44
|
|
45
|
-
if main_input == 0:
|
46
|
-
|
47
|
-
income_input = first()
|
48
|
-
|
49
45
|
.... # 省略
|
50
46
|
|
51
|
-
e
|
47
|
+
while True:
|
52
48
|
|
49
|
+
if main_input == 0:
|
50
|
+
|
51
|
+
income_input = first()
|
52
|
+
|
53
|
+
.... # 省略
|
54
|
+
|
55
|
+
elif main_input == 3:
|
56
|
+
|
53
|
-
fourth(income_input)
|
57
|
+
fourth(income_input)
|
54
58
|
|
55
59
|
```
|
56
60
|
|
2
プログラム修正
test
CHANGED
@@ -9,6 +9,20 @@
|
|
9
9
|
関数の定義
|
10
10
|
|
11
11
|
```python
|
12
|
+
|
13
|
+
def first():
|
14
|
+
|
15
|
+
print("今月の収入を入力してください。")
|
16
|
+
|
17
|
+
income_input = str(input())
|
18
|
+
|
19
|
+
print("今月の収入は"+ income_input +"円です。")
|
20
|
+
|
21
|
+
return income_input
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
12
26
|
|
13
27
|
def fourth(income_input):
|
14
28
|
|
1
プログラム修正
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
これが基本的なルールです。
|
4
4
|
|
5
|
-
今回のプログラムであれば、fourthの引数にincome_inputを渡してあげるようにすれば良いのでは?
|
5
|
+
今回のプログラムであれば、fourthの引数にincome_inputを渡してあげるようにすれば良いのでは? その前にfirstから返してやる必要がありますが・・・。
|
6
6
|
|
7
7
|
|
8
8
|
|
@@ -26,6 +26,14 @@
|
|
26
26
|
|
27
27
|
```python
|
28
28
|
|
29
|
+
income_input = 0
|
30
|
+
|
31
|
+
if main_input == 0:
|
32
|
+
|
33
|
+
income_input = first()
|
34
|
+
|
35
|
+
.... # 省略
|
36
|
+
|
29
37
|
elif main_input == 3:
|
30
38
|
|
31
39
|
fourth(income_input)
|