I am new in python.
I have a list with seperator of "::" and it seems like that;
1::Erin Burkovich (2000)::Drama
2::Assassins (1995)::Thriller
I want to split them by "::" and extract the year from name and add it into the end of the line. Each movie has it own index.
Desired list seems like;
1::Erin Burkovich:Drama::2000
2::Assasins:Thriller:1995
I have below code:
for i in movies:
movie_id,movie_title,movie_genre=i.split("::")
movie_year=((movie_title.split(" "))[-1]).replace("(","").replace(")","")
movies.insert(-1, movie_year)
but it doesn't work at all.
Any help ?
Thanks in advance.