print( [i for i in text if i.isnumeric()] )
#Extract All Digits From a String in Python
text = "The year is 2025 and the time is 09:45."
num = []
for i in text:
if i.isdigit():
num += i
print(num)
print( [i for i in text if i.isnumeric()] )
#Extract All Digits From a String in Python
text = "The year is 2025 and the time is 09:45."
num = []
for i in text:
if i.isdigit():
num += i
print(num)