回答編集履歴
1
追記
test
CHANGED
@@ -1,4 +1,30 @@
|
|
1
1
|
```python
|
2
|
+
def count():
|
3
|
+
list=[] # インデントがあってない
|
4
|
+
print("終了したい場合は終了と入力してください")
|
2
5
|
while True:
|
3
|
-
a=input("数値->") # int()
|
6
|
+
a=int(input("数値->")) # change() 内で int() するならここでする必要がない
|
7
|
+
if a=="終了":
|
8
|
+
return list
|
9
|
+
break # 直前で return しているので無意味な break
|
10
|
+
else:
|
11
|
+
|
12
|
+
list.append(a)
|
13
|
+
a=0 # 無意味な代入
|
14
|
+
|
15
|
+
def guraph(list):
|
16
|
+
while c<len(list): # 宣言されていないcがいきなり使われている
|
17
|
+
c=0 # 謎の代入、多分whileの前に書きたかったのだろう
|
18
|
+
c=list[c] # ループ回数を管理している変数cを上書きしたら不味い
|
19
|
+
print("■"*c)
|
20
|
+
c+=1
|
21
|
+
|
22
|
+
def change(list):
|
23
|
+
for i in range(len(list)):
|
24
|
+
list[i]=int(list[i])
|
25
|
+
return list # いらない
|
26
|
+
|
27
|
+
list=count()
|
28
|
+
change(list)
|
29
|
+
guraph(list)
|
4
30
|
```
|