- 2
How to solve python 16.2 task taking user input
Input is hello and output is *** hello ***
6 Réponses
+ 4
text = input()
output = "***" + text + "***"
print(output)
+ 4
Next time please link first your attempt:
https://code.sololearn.com/cfdc3sipwE8s/?ref=app
+ 2
How do i do 2 samples at the aame time
+ 1
Hello! The objective of your problem is to return the input with *** on the ends. We know that our print() function in python can perform string concatination. String concatination means to combine strings into one, which means that our print() can do operations like print(“hello” + “world”)
What would be the next step in adding the user input to our print statement? That is for you to decide
+ 1
When I first did mine I added an input message as shown in the earlier examples and that gave an incorrect result even though the output was correct. I was only marked correct in the exercise when I removed the input prompt.
Original incorrect code
message=input("Enter your message: ")
output="*** "+message+" ***"
print(output)
Altered correct code.
message=input()
output="*** "+message+" ***"
print(output)
0
Got it thanks suramuthu R