i need to write a function changeName(name) that takes a string value as an argument. where name is in the form last,first,middle. the function should return a string that has the name in form fits,middle,last.
name1 = input("Enter your name")
def changeName(name):
fields = name.split(",")
return fields
fields = changeName(name1)
print(fields[1],fields[2],fields[0])
thanks what i did but it says it is out of range...