this is my code below. I need to take an input from the user (a sentence) and check whether there are any numbers in it from 0 to 10 in it or not. I know there are many ways to approach it, e.g. split(), isalnum(), etc. but I just need help in putting it all together. Please find my code below:
sentence1 = input("Enter any sentence (it may include numbers): ")
numbers = ["1","2","3","4","5","6","7","8","9","10","0"]
ss1 = sentence1.split()
print(ss1)
if numbers in ss1:
print("There are numbers between 0 to 10 in the sentece")
else:
print("There are no numbers in the sentence”)
Thanks :)
Edit: Expected Output should be like:
Enter any sentence (it may include numbers): I am 10 years old
There are numbers between 0 and 10 in this sentence