Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is for an intro to Python class: Write a function called split_into_letters that has a string as a parameter. That string contains a sentence.
This is for an intro to Python class:
Write a function called split_into_letters that has a string as a parameter. That string contains a sentence. You should return a list of lists. Each inner list corresponds to a word. Each item in that inner list is one of the letters in that word.
Say you call the function like this:
print(split_into_letters('How are you today?'))
This should output:
[['H', 'o', 'w'], ['a', 'r', 'e'], ['y', 'o', 'u'], ['t', 'o', 'd', 'a', 'y', '?']]
HINT: You can use the list function to get a list of letters from an individual word, like this:
list_of_letters = list(word)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started