Splitting a person's name into forename and surname

前端 未结 16 2011
北海茫月
北海茫月 2020-12-05 10:46

ok so basically I am asking the question of their name I want this to be one input rather than Forename and Surname.

Now is there any way of splitting this name? and

16条回答
  •  误落风尘
    2020-12-05 10:53

    name = "Thomas Winter"
    first, last = name.split()
    print("First = {first}".format(first=first))
    #First = Thomas
    print("Last = {last}".format(last=" ".join(last)))
    #Last = Winter
    

提交回复
热议问题