Question: Write a function heading(art_title, name) where art_title is the title of a newspaper article and name is the name of its author. The function should
Write a function heading(art_title, name) where art_title is the title of a newspaper article and name is the name of its author.
The function should return a two-line text string that consists of a "titled" copy of art_title followed by the newline character ' ', the word 'by', one empty space ' ', and an uppercased copy of name.
Use the docstring """Creates a two-line heading""".
Do not change the main program. Expected output:
|
Hurricane Irma Hit Florida by AURORA WHITE |
# Main program (do not change): print(heading("hurricane irma hit florida", "aurora white"))
In your function, first insert the docstring.
Then it will be just one line returning the sum of three text strings:
- art_titleto which you apply the methodtitle(),
- a text string consisting of the newline character' 'followed by'by ',
- andnameto which you apply the methodupper().
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
