📜  填充 initials 函数中的空白,以便它以大写形式返回接收到的短语中包含的单词的首字母. - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:01.149000             🧑  作者: Mango

代码示例1
def get_initials(fullname):
  xs = (fullname)
  name_list = xs.split()

  initials = ""

  for name in name_list:  # go through each name
    initials += name[0].upper()  # append the initial

  return initials