+ 3
Input - Tom Alice Bob help please
Alright so Iām really new to coding an this is obviously confusing for me can I please get some guidance or help here
9 Answers
+ 4
Please write relevant keywords in the tags field, such as Python, not "tom", "bob" and "alice", which doesn't help with your question.
Also, with more details, we can identify the question faster. In your case, you can mention which course and which exercise you are having a problem.
From these words and your profile, I guess you are talking about the coding exercise Chatbot from the Python Developer course.
The exercise works this way.
Imagine you are a programmer, and you write a program to print the user's input.
Each test case is a different individual, and your code should work with all test cases.
So you make a program, test case 1 runs it and prints "tom".
With the same program, test case 2 runs it and prints "bob", and so on.
+ 1
Sorry for the miscommunication but yes the chatbot practice. Im new to this jus tryna excersize my brain with new experience.
I can get the first to run but cant get alice an bob to be executed
+ 1
If you share your code, then we can identify the problem.
If the code contains a few lines, you can simply write it here.
Later, you may find this useful if your code is lengthy.
https://sololearn.com/compiler-playground/Wek0V1MyIR2r/?ref=app
+ 1
Im new all im tryna do is pass this practice test an ive tried with variables and input but adding multiple names doesnt work
name = (āTomā)
name1 = (āAliceā)
name2 = (āBobā)
Then i do the print name1,2,3 it doesnt work so my problem is having them showing up in output individually
+ 1
Yep i got it now thankyou was really difficult but after i got it made sense thanks for replying to my message
0
Chatbot V1
0
You only need TWO lines of code to complete the task, just like the comments provided.
# Ask the user for input and store it in a variable
# Display the user input on the screen
Each test case will run these 2 lines of code individually.
So the first case will assign "Tom" into the variable and print it out.
And second case will assign "Alice" into the variable and print it out.
0
It wasnt askin for a name it wanted () blank info that should be changed in the description of the task
0
You misunderstand how the exercise works.
Here is the complete solution.
name = input()
print(name)
Test case 1, 2 and 3 are separated, but all of them run the same code.
Your task is to create a single program, and the program can handle all the test cases.
Your solution is called "Hardcoded". It doesn't ask the user (test case) for input and assign to a variable.
With your code, if you added print(name) as the last line, it always prints Tom because the program is instructed to do so.