#can be done through regex library
import re
some_string = '31 Kaiser Friedrich Avenue'
#use the findall() method to find number within the string
#the ‘d+’ would help find digits
num = re.findall(r'd+', some_string)
print(num)
# result would be ['31']