First of all, you should not make a list out of x. so just left line with input().
Second. In for i in f: i is line, not a word. If you want to read words from line you have to do
file = open('filename.txt')
items = file.readline().split(', ')
But it's good practice to open files with 'with':
with open('packed.txt', 'r') as f:
items = f.readline().split(', ')
Second argument in open() is 'r', this is the way to tell python we want to open the file in read mode. If you want to read about other modes go here
If you really want to use classic way remember about close the file with 'file.close()'
In your case because items in your file are separated by ','. we are using split(',') so now we have list of your items.
Now you just have to check if item that you entered is on the list.
if item in packed_items:
print("It's packed.")
after all code should looks more/less similar to this one:
item = input('Check item: ')
with open('packed.txt', 'r') as f:
items = f.readline().split(', ')
while item:
if item in items:
print("It's packed.")
else:
print("You haven't packed it yet!")
item = input('Check item: ')
If you want to check multiply items at once add this after first line:
item = item.split()
And then change:
if item in items:
print("It's packed")
else:
print("You haven't packed it yet!")
to:
for check in item:
if check in items:
print(check + ' is packed')
else:
print(check + ' is not packed yet')
And add this line 'item = item.split()' at the end of file after but within the while loop:
item = input('Check item: ')
Sorry for any misspelling :). Hope its helpful :)