Please program this in Python
Write the function spell_name that will takes a name as its input, then returns a list where each character in their name is an element.

For example,

spell_name('Jessica')
# => ['J', 'e', 's', 's', 'i', 'c', 'a']
spell_name('Ariel')
# => ['A', 'r', 'i', 'e', 'l']

# fill in this function to return a list ontaining each character in the name
def spell_name(name):
return []

Respuesta :

def spell_name(name):

   return [x for x in name]

print(spell_name("Jessica"))

I wrote my code in python 3.8. I hope this helps.

fichoh

The program returns list containing each individual letter in a string. The function written in python 3 goes thus :

def spell_name(str):

#initialize a function named spell_name which takes in a single parmater which is a string.

return [letter for letter in str]

#using list comprehension separate each individual letter in the string as an individual element.

print(spell_name('Aisha'))

#A sample run of the program with the string 'Aisha'.

The output of the sample program is attached.

Learn more : https://brainly.com/question/19012132

Ver imagen fichoh