Write a function that returns a string in which firstname is swapped with last name.
My code:
def name_shuffler(str_):
names = str_.split()
return names[1] + " " + names[0]
def name_shuffler(str_):
return ' '.join(str_.split(' ')[::-1])
def name_shuffler(str_):
return ' '.join(str_.split(' ')[::-1])