+ 1
User input
Can someone help me understand this? I keep assigning a input but it keeping outputting it twice. I have reached the 16.2 questions and regardless of my input the output keeps coming back with other wording. Write a program that takes the text as input and outputs it by adding 3 stars at the beginning and the end. Sample Input this is awesome Sample Output *** this is awesome *** Every time I attempt my code the word hello is inputted also even though it’s not put in
20 Answers
+ 6
Victoria Thomas ,
if you use the code done by Jotin Rai , you can not pass the test cases because:
(the code itself has no issue, but it is not conform with the task description)
a = input("Plzz enter some text")
print("★★★",a,"★★★")
▪︎input has an argument, which is not allowed in code coach exercises
▪︎the code uses some special stars for output, and therefore will also fail with the test cases
try this:
▪︎remove everything inside the parenthesis of the input() function: a = input()
▪︎replace the special stars by this: '***'
happy coding and good success!
+ 5
Victoria Thomas ,
the code works as expected. if you input "Tom" as name, the screen will show:
Enter your name: Tom
Hello, Tom
the first line is the user prompt and what you have typed in, the second line is the output. this is when the code is executed in a external IDE.
in sololearn the output is different:
Enter your name: Hello, Tom
this is caused by the way playground is working
+ 4
Cholohatwhite ,
please do not post irrelevant content here. your post has no relation to the question, and can be considered as spam.
thanks for your understanding!
+ 2
Simply input function prints your argument then waiting enter key to be pressed then read what user was typed until '\n' in other word ( enter key ) and return you back with user input
if you miss some thing, mention me
+ 2
name = input()
print(f"Hello, {name.title()}")
+ 2
Easiest Way:
text=input()
print(f"*** {text} ***")
+ 1
Lothar & Kyrillos Akram ,
The 16.2 exercise in Python isnt giving me these result. The results keep showing different words than the ones i am using
+ 1
Hi Victoria!
Did you try something else?
name = input()
print("Hello, "+name)
But for me, 16.2 shows a different challenge.
+ 1
Hi JUMP_LINK__&&__Python__&&__JUMP_LINK Learner
Thats just the example i posted because the challenge is confusing me. It saying to use the format of the example to create ***this is awesome*** symbols included but when i use the formula given in the example my answers come back with the word hello and i didnt even type in hello.
+ 1
Will u share your code link so that we can tell your mistakes
+ 1
https://code.sololearn.com/cIWKFl0NgNqh/?ref=app
This is the solution for you.
+ 1
Hiii
+ 1
Jotin Rai Time Is Money
I tried that input and it keeps says that other words i didnt use are being inputted
https://sololearn.com/coach/1033/?ref=app
+ 1
Share your code
+ 1
Time Is Money
My code is what was suggested by Jotin Rai. I can’t share what was ran since it’s a challenge. When what he suggested is ran no matter what is put in that sequencer extra wording of hello is added. Nothing is wrong with the code i need to figure out why the extra wording is showing
+ 1
Lothar
Thank you! This solution worked.
0
def printBill(text):
print("======")
print(text)
print("======")
printBill(input())
done...!
- 1
sure!
the answer is:
a=input("Tu nombre >")
print( f " hello! welcome {a} nice day! " )
output:
hello! welcome cholohatwhite nice day!