0

Why is Python beginners chatbot v1.1 saying error when my output and expected output is same

14th May 2023, 9:21 AM
Keturah Cutting
Keturah Cutting - avatar
28 ответов
+ 10
I have looked at your code, and found the error. The error is that you forgot to add the space after the coma in the message variable. This can result in an incorrect output, from the code challenge, as they require your output to be exactly same as their output. Here is the solved program: # Use name as input name = input() #Use concatenation to join 2 strings message = "Nice to meet you, " + name #Display message to user print(message)
15th May 2023, 2:25 PM
Danish Zubair
Danish Zubair - avatar
+ 6
Your code is correct. Maybe there is a mistake in punctuation marks or spellings. If it is also correct then it may be a bug or error
14th May 2023, 9:57 AM
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
+ 6
I am having issues with this and I cannot move past it I am getting the correct code for Mary but it is not generating the code for the other two people how do I get it to populate the correct code for all three people at the same time so I can pass onto the next lesson?
3rd Jul 2023, 11:31 PM
KBradley
KBradley - avatar
+ 2
Share the code
14th May 2023, 9:34 AM
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
+ 2
Solve this for me, With these names Mary Robert Anna # Take the name as input name = input() # Use concatenation to join 2 strings message = "Nice to meet you, " + name # Display the message to the user print(message)
20th Jun 2023, 10:55 AM
Daniel Baranya
Daniel Baranya - avatar
+ 1
Okay thanks I thought it may be that. Any ideas how to get the error solved?
14th May 2023, 9:59 AM
Keturah Cutting
Keturah Cutting - avatar
+ 1
Keturah Cutting no problem, that is the way we learn. Thank you for making my answer as the best answer.
15th May 2023, 5:25 PM
Danish Zubair
Danish Zubair - avatar
+ 1
It isn't about the specific name. They're asking you to join the 2 strings. Leave the word "name" as it is and fill in the missing symbol(s) to complete the code. Good luck!
16th May 2023, 4:55 AM
Keturah Cutting
Keturah Cutting - avatar
+ 1
Keturah Cutting Can you please share the code here? I'm having problem with it too
16th May 2023, 5:43 AM
Gabriel Boakye Poku
Gabriel Boakye Poku - avatar
+ 1
16th May 2023, 6:06 AM
Gabriel Boakye Poku
Gabriel Boakye Poku - avatar
+ 1
Only # testcase1 is correct remaining 2 cases have bugss
16th Jun 2023, 7:42 AM
Sahiti
+ 1
I keep getting test 1 and 2 wrong for some reason but it completes the third one what can I do to rectify that
29th Aug 2023, 3:15 PM
Bonga Mabaso
Bonga Mabaso - avatar
+ 1
I am getting the correct code for Mary but it is not generating the code for the other two people how do I get it to populate the correct code for all three people at the same time so I can pass onto the next lesson?
1st Sep 2023, 6:56 AM
Faith Okewale
0
# Use name as input name = input() #Use concatenation to join 2 strings message = "Nice to meet you, " name #Display message to user My answer: # Use name as input name = input() #Use concatenation to join 2 strings message = "Nice to meet you, " + name #Display message to user print(message)
14th May 2023, 9:53 AM
Keturah Cutting
Keturah Cutting - avatar
0
This is why it's better to post a link to a code bit, rather than just c/p-ing text. Hard to debug typos that we can't see
14th May 2023, 2:03 PM
Orin Cook
Orin Cook - avatar
0
I would like to do that but I'm on the mobile app not sure how to
14th May 2023, 6:26 PM
Keturah Cutting
Keturah Cutting - avatar
0
Oh my Danish Zubair ! You are absolutely correct! I just tried it and after numerous attempts of wondering what was wrong, I got it. Thank you so much! You taught me something here today. Thanks to everyone else who attempted to help as well. Appreciated.
15th May 2023, 2:45 PM
Keturah Cutting
Keturah Cutting - avatar
0
Ok so theres three names: Mary, Robert, Anna. This is what i did for test case #1 and i got it correct. ~ # Take the name as input message = "Nice to meet you, " name = "Mary" # Use the concatenation to join 2 strings # Display the message to the user print(message + name) ~ I copied and pasted the exact same as above directly under with spaces and just changed the name to ‘robert’ but it didnt run. In fact test case #1 and #2 didt work? I have the right solution but cant get all three right simultaneously
16th May 2023, 4:14 AM
Shireen Begum
0
If you go up in the comments, you'll see it was posted by Danish Zubair. You leave the first line of code as is. You leave everything they gave you in the second line of code as is including the space between (you,) and the quotation mark (") and just add the plus sign (+) before the word "name". For the third line you simply: print(message)
16th May 2023, 5:55 AM
Keturah Cutting
Keturah Cutting - avatar