In python, I am trying to create a program that checks if lines are in a line, but I seem to get an error. Here is my code:
numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
test = input()
print(test)
if numbers in test:
print("numbers")
Here is my mistake:
TypeError: 'in <string>' requires string as left operand, not list
I tried changing the numbers to numbers = "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"which I basically deleted [], but that didn't work either. I hope I can get an answer; thank:)
source
share