+ 1

Write a program that takes text input and output it by adding 3 stars

Expl *** hello *** Note space between stars and text

24th Oct 2021, 10:07 AM
Teach Me How To Code
Teach Me How To Code - avatar
20 Answers
+ 6
Let's see your attempt!
24th Oct 2021, 10:08 AM
Slick
Slick - avatar
+ 6
Its just simple write statement for how to take input and store it into variable then use print statement print 3star then value then print three Star
24th Oct 2021, 10:11 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 3
Cԋιɠσȥιҽ Aɳყαҽʝι [Not Online] Your answer to the question is accurate & appreciated by the OP. However, without an explanation, it is highly unlikely he will understand why. I admire you for wanting to help, but please explain the concepts behind the answer.
24th Oct 2021, 12:04 PM
Rik Wittkopp
Rik Wittkopp - avatar
+ 3
Rik Wittkopp Thanks 😊 2BpenciL YT the input variable takes an input using the input() function. And the I output it using console and then add the three stars at beginning and end using string. Hope I explained.
24th Oct 2021, 4:07 PM
Chigozie Anyaeji 🇳🇬
Chigozie Anyaeji 🇳🇬 - avatar
+ 3
Simon Sauter Lol 😂 If u want space put it bruh
25th Oct 2021, 7:24 AM
GURURAJ KL
GURURAJ KL - avatar
+ 3
Finally the solution is 👇 text = input( ) print("*** " + text + " ***") #Thanks to simon Sauter for good explanation and thanks to all
26th Oct 2021, 11:13 AM
Teach Me How To Code
Teach Me How To Code - avatar
+ 2
Cԋιɠσȥιҽ Aɳყαҽʝι [Not Online] the code you've given above is wrong. 1. It doesn't take the spaces into account. 2. console.log() is not python.
24th Oct 2021, 5:41 PM
Simon Sauter
Simon Sauter - avatar
+ 2
АлКа Релова you missed the spaces.
25th Oct 2021, 7:45 PM
Simon Sauter
Simon Sauter - avatar
+ 2
I'm not a fan of outright giving people the solutions to problems. But since there are several wrong answers in this thread I think it's necessary in this case. Version 1: text = input() print("*** " + text + " ***") # note the spaces within the quotation marks Version 2: text = input() print("***", text, "***") # in this case python uses the print function's default separator, which is a space
25th Oct 2021, 7:54 PM
Simon Sauter
Simon Sauter - avatar
+ 2
ss the task explicitly says that the program has to take input, so your second code is one more for the "wrong answers heap". The first one comes on the "correct answers that have already been given heap".
26th Oct 2021, 9:34 AM
Simon Sauter
Simon Sauter - avatar
+ 1
input = input() console.log("***"+input+"***")
24th Oct 2021, 10:18 AM
Chigozie Anyaeji 🇳🇬
Chigozie Anyaeji 🇳🇬 - avatar
+ 1
GURURAJ KL you missed the spaces.
25th Oct 2021, 3:14 AM
Simon Sauter
Simon Sauter - avatar
+ 1
Yes he should. But since there are several wrong answers here now there's a strong possibility that he won't be able to figure it out.
25th Oct 2021, 8:03 PM
Simon Sauter
Simon Sauter - avatar
0
Simon Sauter But he didn't ask for space
25th Oct 2021, 7:57 PM
Chigozie Anyaeji 🇳🇬
Chigozie Anyaeji 🇳🇬 - avatar
0
Cԋιɠσȥιҽ Aɳყαҽʝι [Not Online] Reread his question. It's right there.
25th Oct 2021, 7:58 PM
Simon Sauter
Simon Sauter - avatar
0
But he must know how to add it himself.
25th Oct 2021, 8:01 PM
Chigozie Anyaeji 🇳🇬
Chigozie Anyaeji 🇳🇬 - avatar
- 1
Simon Sauter it's not wrong. Only console.log() does not work. I just added it for better understanding.
24th Oct 2021, 5:52 PM
Chigozie Anyaeji 🇳🇬
Chigozie Anyaeji 🇳🇬 - avatar
- 1
2BpenciL YT #Python Solution print(f"***{input()}***")
25th Oct 2021, 2:38 AM
GURURAJ KL
GURURAJ KL - avatar
- 1
stt=input("enter string") print ('*'*3,stt,'*'*3) OR Stt="hello" print ('*'*3,stt,'*'*3)
26th Oct 2021, 9:24 AM
ss
ss - avatar