An acrostic is a text in which the first letter of each line spells out a word. It is also a quick and cheap way of writing a poem for somebody, as exemplified below :



Write a program that reads an acrostic to identify the "hidden" word. Specifically, your program will receive a list of words (reprensenting an acrostic) and will need to return a string corresponding to the word that is spelled out by taking the first letter of each word in the acrostic.

Difficulty: introductory

Starter code:

def read_out(acrostic):
	

Solutions:
def read_out(acrostic):
    return "".join( word[0] for word in acrostic )

def read_out(acrostic):
    return ''.join(next(zip(*acrostic)))

from operator import itemgetter

def read_out(acrostic):
    return ''.join(map(itemgetter(0), acrostic))

def read_out(acrostic):
    return ''.join(e[0] for e in acrostic)

def read_out(acrostic):
    return ''.join(w[0] for w in acrostic)

def read_out(acrostic):
    return ''.join(s[0] for s in acrostic)

#  WHO  WORE  IT  BETTER  ??

' 1) LOOP CAT ? '
def read_out(array):  #  2 seconds
    acrostic = ''
    for word in array:
        acrostic += word[0]
    return acrostic

' 2) LIST COMP ? '
read_out = lambda a: ''.join(w[0] for w in a)  #  3.6 seconds

' 3) MAP OBJ ? '
read_out = lambda a: ''.join([w[0] for w in a])

#  YOU  DECIDE  !!

# VOTE: 1, 2, or 3


def read_out(acr):
    return ''.join( map(lambda a:a[0] , acr ) )

def read_out(a):
    return ''.join(c[0] for c in a)

def read_out(acrostic):
    return ''.join(i[0] for i in acrostic).upper()