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
9/21/2021 3:34:51 PM
Victoria Dunnaway
20 Answers
New AnswerVictoria 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!
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
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!
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
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
Hi Victoria! Did you try something else? name = input() print("Hello, "+name) But for me, 16.2 shows a different challenge.
Hi Python 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.
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
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
def printBill(text): print("======") print(text) print("======") printBill(input()) done...!
sure! the answer is: a=input("Tu nombre >") print( f " hello! welcome {a} nice day! " ) output: hello! welcome cholohatwhite nice day!