誰でもこのコードがうまくいかない理由を教えてください。リストからアイテムを検索するには?
lst=[5,9,2,5,13]
item = int(input("Please enter the search item."))
found = False
for search in range(len(lst)):
if item == (lst[search]):
found = True
if found:
print('{} is in the list'.format(item))
else:
print('{} is not in the list'.format(item))
それは本当にPythonのではないので、それが動作しないことができます。構造化チュートリアルを強くお勧めします。 https://sopython.com/wiki/What_tutorial_should_I_read%3F – jonrsharpe