I'm very new to python and am having trouble with the following bit of code. The aim is to create a function that prints all the integers within a string.
def get_digits(str1):
for i in str1:
if i.isdigit():
return i
However it is only returning the first integer in the string, and I am unsure on how to get it to print all of them.
My apologies if the question is stupid, I have looked around for a while on this site and others and haven't been able to work it out.