Answered step by step
Verified Expert Solution
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
headerHello World!
Hello, World!
headerPython Rocks
Python Rocks
headerCoders EVER
Coders EVER
Steps to Implement:
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
printlenstring # display top line
print string, # display middle line
printlenstring # display bottom line
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
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