• frame: takes in a short sentence (string with words separated by spaces) and returns a string that represents the words with newlines, aligned to the left, surrounded by a frame of *' symbols. o Example: frame("one two three") would return *\n*three*\n********. If you were to print this output, it would look like *****\n*one *\n*two this: ******* *one *two *three* *******

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter7: User-defined Simple Data Types, Namespaces, And The String Type
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question
100%

Implement the following function:

*Code should be in python

• frame: takes in a short sentence (string with words separated by spaces) and
returns a string that represents the words with newlines, aligned to the left,
surrounded by a frame of *' symbols.
o Example: frame("one two three") would return *******1
*\n*three*\n*****
**\n*one *\n*two
. If you were to print this output, it would look like
this:
*******
*one
*
*two
*three*
*
*******
Transcribed Image Text:• frame: takes in a short sentence (string with words separated by spaces) and returns a string that represents the words with newlines, aligned to the left, surrounded by a frame of *' symbols. o Example: frame("one two three") would return *******1 *\n*three*\n***** **\n*one *\n*two . If you were to print this output, it would look like this: ******* *one * *two *three* * *******
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Program on Numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,