エラーについて調べたのですが、解決できませんでした。
このエラーについて詳しく知りたいです。 AttributeError: 'list' object has no attribute 'split'
Python
Python
1count = 0 2b = [] 3# bに入力されるデータ 4# 36 70 1 72 54 82 5# 36 2 40 12 3 58 6# 25 11 90 57 85 99 7 8a = '72 2 90 84 57 85' 9n = '3' # 入力数 10 11a = a.split() #リストを文字列に変換 12 13for x in range(5): 配列aの添え字用 14 for y in range(5): 配列bの添え字用 15 b[y] = b.append(input()) # bをリストに追加 16 b[y] = b.split() # エラー箇所 17 if a[x]==b[y]: 18 count += 1 19 print(a[x]==b[y]) 20 print("\n") 21print(count) 22 23 24
エラー内容
code
1**Runtime error** 2Traceback (most recent call last): 3 File "Main.py", line 15, in <module> 4 b[y] = b.split() 5AttributeError: 'list' object has no attribute 'split'
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/11 16:09