Write a program that takes the text as input and outputs it by adding 3 stars at the beginning and the end. Sample Input thi | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Write a program that takes the text as input and outputs it by adding 3 stars at the beginning and the end. Sample Input thi

In this there are 2 cases. Output for the first case is correct but not for the 2nd case. Could someone please help me out ? Case 1 user = input("*** hello ***") Case 2 user = input("*** python is awesome ***") (Somehow it shows wrong output for the 2nd case)

12th Jun 2021, 4:56 PM
Sanchit Bahl
Sanchit Bahl - avatar
6 Answers
+ 2
Sanchit Bahl Here are some ways in which you can do this: print("*** " + input() + " ***") # Okay OR print("{0} {1} {0}".format("***", input()) # Not recommended OR print(f"*** {input()} ***") # Okay # Also, '*' is called an 'asterisk'. # Hope this helps
12th Jun 2021, 7:01 PM
Calvin Thomas
Calvin Thomas - avatar
+ 1
Thank you for your help!
12th Jun 2021, 5:28 PM
Sanchit Bahl
Sanchit Bahl - avatar
+ 1
That was really very helpful and generous of you Calvin Thomas , thanks alot.
16th Jun 2021, 6:13 PM
Sanchit Bahl
Sanchit Bahl - avatar
0
the second case is also working properly please use python idle and run it again thank you
12th Jun 2021, 5:25 PM
Swamy
Swamy - avatar
0
Then give a upvote bro😍
12th Jun 2021, 5:32 PM
Swamy
Swamy - avatar
0
Sanchit Bahl You're welcome.
17th Jun 2021, 2:29 AM
Calvin Thomas
Calvin Thomas - avatar