#eval() z=eval(input("enter the list:")) n=int(input("enter the list to search:")) freq=z.count(n) if freq>0: print(n,"occurs",freq,"times") else: print(n,"does not occur")
Here is what the above code is Doing:
1. It takes a list as input from the user.
2. It takes a number as input from the user.
3. It counts the number of times the number occurs in the list.
4. If the number occurs more than 0 times, it prints the number and the number of times it occurs.
5. If the number does not occur, it prints the number and says that it does not occur.