Single-element list

Report a typo

Helen wants to create a list containing only one element – a string with her name. To do this, she wrote this line of code:

name = list('Helen')

However, when she prints the list, her name appears broken into several one-letter strings:

print(name)
# ['H', 'e', 'l', 'e', 'n']

Why? Fix this code.

Write a program in Python 3
name = list('Helen')
print(name)
___

Create a free account to access the full topic