I want to take only the years in this string and place in a list
a = "Sam works in a company abc in New York. He joined the company last year 2019. Before joining ABC, he used to work for a small firm in Arizona. He worked there from 2015 to 2018. Before moving to Arizona Sam used to live in South Dakota and he has been living there since 2000's"
b = a.split()
year = []
for i in b:
if i.isdigit():
year.append(i)
print(b)