program-
#import the re module
import re
#take input of string
print("Enter string")
s=input()
#fill all numbers from the string
x=re.findall('d',s)
print("Number that are present in string :",x)
Enter string
string1234 is a perfect 345 string
Number that are present in string : ['1', '2', '3', '4', '3', '4', '5']
Enter string
In this string,number is not present
Number that are present in string : []
Enter string
123456789
Number that are present in string : ['1', '2', '3', '4', '5', '6', '7', '8', '9']