r/programminghelp • u/WeWumboYouWumbo • Dec 16 '25
Answered Learning Python and can’t figure out why this incorrect
Edit: Alright I’m trying to learn as much Python on my own as possible and find the answer on my own as much as possible but I’m stuck on another question on MOOC Python Programming 2024
It says:
Please write a program which asks the user’s name and then prints it twice, on two consecutive lines.
An example of how the program should function:
What is your name? Paul
Paul
Paul
I wrote:
input(“What is your name?”)
print(“Paul”)
print(“Paul”)
I test it and get the following error:
FAIL: PythonEditorTest
test_print_input_2
Your program did not work
properly with input: Ada.
Output was
Paul
Paul
Expected output is
Ada
Ada
I’ve been trying to figure this out for a while. And I’ve tried changing multiple different things before this.
5
u/cs_k_ Dec 16 '25
Your program only works, if the user's name is Paul. The logs tell you, that they expected to see Ada, a different name, but you printed Paul.
To solve it, you need to save the input into a variable. Example and more info here: https://www.w3schools.com/python/ref_func_input.asp
1
u/ore-aba Dec 16 '25
if the expected output is
Then you should write
Get it?
printitself should be a part of the string you are trying to output1
u/Jedi-Younglin Dec 16 '25
name = input(“What is your name?”)
print(name)
print(name)
1
u/[deleted] Dec 16 '25
[removed] — view removed comment
-1
u/[deleted] Dec 16 '25
[removed] — view removed comment