Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Fill in the gaps in the initials function so that it returns the initials of the words contained in the phrase received, in upper case.

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
 
PREVIOUS NEXT
Tagged: #Fill #gaps #initials #function #returns #initials #words #contained #phrase #upper
ADD COMMENT
Topic
Name
2+2 =