In my code below, I am trying to print all numbers in a string. The output prints 10, 20, 30, None. I understand the "None"is printed because I am not "return"anything in the function. How do i best re-write this code to avoid "none" being output.
import re
def myfunc(string):
patterns=r'\d+'
array=re.findall(patterns,string)
for n in array:
print(n)
print(myfunc("Ten 10, Twenty 20, Thirty 30"))