python generate number from string code example
Example 1: python random string
import secrets
secrets.token_hex(nbytes=16)
# this will produce something like
# aa82d48e5bff564f3221d02194611c13
Example 2: how to get a number from a string in python
string = "I am 14 years old"
for i in string.split():
if i.isdigit():
print(i)
print()