Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function, header, that takes a string text and a single character surround as parameters and displays the following: Example call Displays header (

Write a function, header, that takes a string text and a single character surround as parameters and
displays the following:
Example call Displays
header(Hello, World!,*)*****************
* Hello, World! *
*****************
header(Python Rocks,!)!!!!!!!!!!!!!!!!
! Python Rocks !
!!!!!!!!!!!!!!!!
header(Coders 4 EVER,+)+++++++++++++++++
+ Coders 4 EVER +
+++++++++++++++++
Steps to Implement:
1. Understand what to implement
Begin with an example. Write the lines of code to output one of the example test cases. You
may find it useful to make variables for values that are used multiple times:
string =Hello, World! # text to display
print(**(len(string)+4)) # display top line
print(*, string, *) # display middle line
print(**(len(string)+4)) # display bottom line
2. Test the code
Run the code to ensure the output matches the target example

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

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions

Question

2 What are the advantages and disadvantages of job evaluation?

Answered: 1 week ago

Question

1 Name three approaches to job evaluation.

Answered: 1 week ago