swap name and surename with that is spaced with ,

Question:

I am fetching names from tags in wikipedia like this:

k = BeautifulSoup(str(Position),"html.parser")         
name = k.find('a')['title']

names in this case will result in this

'Bassey, Charles'

Is there a way I can convert the names that are spaced like this to this:

'Charles Bassey'
Asked By: ili

||

Answers:

last_first = 'Bassey, Charles'
last_name,first_name  = last_first.split(',')
fullname = f'{first_name},{last_name}'
print(fullname)

output

Charles,Bassey
Answered By: Carl_M
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.