Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions