- 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)
6 ответов
+ 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
+ 1
Thank you for your help!
+ 1
That was really very helpful and generous of you Calvin Thomas , thanks alot.
0
the second case is also working properly
please use python idle and run it again thank you
0
Then give a upvote bro😍
0
Sanchit Bahl You're welcome.