The input is a string, not an array. To turn it into an array, use this:
arr = [(item) for item in input("Enter the list items: ").split()]
Together, your code should look like this:
arr = [(item) for item in input("Enter the list items: ").split()]
print(arr)
num = input("enter num: ")
print(num)
for n in arr:
if num == n:
print("yes")
else:
print("no")
NOTE: the input for the list should be in the format 3 6 8 1 8
.
Alternativley, you could use if... in... to check. Try something like this:
arr = input("enter array:")
print(arr)
num = input("enter num:")
print(num)
if num in arr:
print("yes")
else:
print("no")
However, I wouldn't reccomend this because you don't use a list, you use a string, so it can get messy!