- 1

You’re working on a notification system and need to make the notification text eye-catching.

You’re working on a notification system and need to make the notification text eye-catching. Write a program that takes the text as input and outputs it by adding 3 stars at the beginning and the end. This is the code, which is not working.(It prints both the output together. How do I separate them?) The the 1st output should be ***hello*** and 2nd ***python is awesom*** text = input() print("***" + "hello" + text + "python is awesome" + "***")

24th Jun 2021, 1:34 AM
Sanchit Bahl
Sanchit Bahl - avatar
15 Respostas
- 1
maybe this will work: text=input() print(f"***hello {text}***", "***python is awesome***", sep=",\n") i just merged the two and separated with a new line.
24th Jun 2021, 6:01 AM
you are smart. you are brave.
you are smart. you are brave. - avatar
+ 3
text=input() print("***",text,"***") completely correct answer
26th Dec 2021, 10:39 AM
Not Dr. Ujjwal
+ 1
x = input() asterx = "***" print(asterx+x+asterx) also Andrew Choi gave a great answer: print(f'***{x}***')
24th Jun 2021, 5:14 AM
Shadoff
Shadoff - avatar
+ 1
This took way longer than necessary but after messing around, I finally got it correct. Tip: set x= ""; for the spacing ( mixed with +) use \n at the end to put outputs on a different line.
14th Sep 2021, 4:31 PM
Kerri Cool
Kerri Cool - avatar
+ 1
print(f"*** {input()} ***")
24th May 2022, 4:04 PM
Mazitov Radmir
Mazitov Radmir - avatar
+ 1
# copy and paste the simple code below text = input() print("*** "+ text + " *** ") # this would work
10th Jun 2022, 10:28 PM
Ellyjah
Ellyjah - avatar
0
are you looking for something like this? text=input() print(f"***hello {text}***") print("***python is awesome***") i just created 2 print statements.
24th Jun 2021, 1:44 AM
you are smart. you are brave.
you are smart. you are brave. - avatar
0
I also tried creating to print statements but not with the formatted string. Now I will try with formatted string, hope it works.
24th Jun 2021, 2:06 AM
Sanchit Bahl
Sanchit Bahl - avatar
0
Still not working, now it's printing hello twice and the 2nd statement is not printed seperately
24th Jun 2021, 2:12 AM
Sanchit Bahl
Sanchit Bahl - avatar
0
I use \t tabs
6th Sep 2021, 6:54 PM
SAURABH BHAUSAHEB PATOLE
SAURABH BHAUSAHEB PATOLE - avatar
0
text = input() print("***\thello ***") print("***\tpython is awesome ***") had the same thing but it still won't work. I have also tried all other solutions. It is printing both out on different lines but isn't correct?
14th Sep 2021, 4:07 PM
Kerri Cool
Kerri Cool - avatar
0
text=input() print("***",text,"***") try this after so many failed attempts I got this
18th Sep 2021, 2:38 PM
Avinash Kumar Singh
Avinash Kumar Singh - avatar
0
solution : x = input () text = ("*** " + x + " ***") print = (text)
19th Sep 2021, 1:57 AM
Ilham Dio Putra
Ilham Dio Putra - avatar
0
This is work for me đŸ‘‡đŸœđŸ‘‡đŸœđŸ‘‡đŸœ #your code goes here text=input() print(f"*** {text} ***")
24th Oct 2021, 2:16 AM
Nurmahidah
Nurmahidah - avatar
- 1
text = input() print("***\thello ***") print("***\tpython is awesome ***") It works but how to seperate them???
6th Sep 2021, 6:53 PM
SAURABH BHAUSAHEB PATOLE
SAURABH BHAUSAHEB PATOLE - avatar