Oct-19-2017, 08:03 PM
(This post was last modified: Oct-19-2017, 08:40 PM by sparkz_alot.)
Below is one solution that works, just a number of simple
print statements in Python3
Enter message:- Hello World
*********************
* *
* Hello World *
* *
*********************
You should be able to see how it works, it adds five "*" to beginning
and end of message, and adds a single "*" and four spaces to blank lines
print statements in Python3
#!/usr/bin/env python msg = input("Enter message:- ") ch="*" sp=" " print(ch*(10+len(msg))) # print * print(ch + (sp*(8+len(msg)))+ ch) print("* " + msg + " *") print(ch + (sp*(8+len(msg)))+ ch) print(ch*(10+len(msg))) # print *Below is the output:
Enter message:- Hello World
*********************
* *
* Hello World *
* *
*********************
You should be able to see how it works, it adds five "*" to beginning
and end of message, and adds a single "*" and four spaces to blank lines