+ 6
Need help on chatbotV1.0
There are 3 tests on this and I can not figure out how to code to get each name in each different test space Supposed to be test#1 “Tim” Test #2 “Alice” And test number 3 “Bob” Everytime I try to code it all three names go under eachother in each test space nothing is in their separate test spaces how do I solve ? Please help
42 Réponses
+ 9
I just got it! I was making it way too complicated the answer code was
Name= input()
Print(name)
And that filled all correct spaces to their correct names i did not need to write as many codes as i did !
Thank you so much for helping me through this to the best you could for what i was giving!
+ 7
Shireen Begum
# 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)
+ 6
Hi,
I found the solution here you are:
I don't know if it is the best way, but at least it works. Good luck:
name = input()
if name == "Tom":
print("Tom")
if name == "Alice":
print("Alice")
if name ==("Bob"):
print("Bob")
+ 3
# Ask the user for input and store it in a variable
name = ("Tom")
name2 = ("Alice")
name3 = ("Bob")
# Display the user input on the screen
print(name)
print(name2)
print(name3)
This is also another way (i erased input because it was putting the name tom 2 times)
+ 2
I believe i am in python
+ 1
I just started coding for the first time last night this is my firat app i got 3 others so im very new. I understood everything else this is the first problem that i am stumped on
+ 1
No they are not when it goes to the results side it says test#1 and that box should be “Tom” then it goes to test#2 which that box should be “Alice”
Then test#3 should be “Bob”
Each needs an input and output but when i put more than one input it says everything except the 1 input “can not be definied” so i just have no idea what else to so based off of what ive learned so far to break these names up to get them into their correct test spaces without all 3 names going into the same test space
+ 1
# Ask the user for input and store it in a variable
name =
# Display the user input on the screen
This is where its asking me to code
0
It's a little hard to tell what you mean exactly, better maybe to copy the exact expected and actual outputs so we can see for ourselves.
That said it kinda sounds like one problem you're having might be with the way the sololearn playground handles inputs. It only takes everything all at once at the beginning, but you can separate multiple different inputs on separate lines, like eg:
Tim
Alice
Bob
0
https://sololearn.com/coach/963193144/?ref=app
This is the explanation of what needs to he done ill also copy the first page if the practise page
0
https://sololearn.com/coach/963193144/?ref=app
I left the results empty which is obviously why its saying its wrong this time but this is how it needs to be put in, in the results
0
Thank you im still having the same problem its saying im asking for two inputs but only one is defined is this a computer problem? I just dont know what other way to put this in… is there a way i can also contact sololearn and maybe find out more ? I still appreciate any help anyone is willing to give me
0
Ive been trying to write codes a few different ways. I posted a link thats empty. Ill try again to write the code and ill post a new link maybe you can help with the errors im making
0
https://sololearn.com/coach/963193144/?ref=app
Im gonna do it 1 more way ive tried and post that link also
0
This link doesn't work either. Write the code here, it will be easier.
0
https://sololearn.com/coach/963193144/?ref=app
When i do it this way this is where it gives me the “your code asks for input twice but only one input is defined”
0
Okay sorry i will now
0
# Ask the user for input and store it in a variable
name = input();
name2 = input();
name3 = input()
name = "Tom"
name2 = "Alice"
name3 = "Bob"
# Display the user input on the screen
print(name)
print(name2)
print(name3)
(This is one way ive tried)
0
Hmm, what you wrote now without error
0
So when i erased input i dont get an error but the names do not go in the correct test spaces. They all go into each test space they should be 3 names in 3 seperate test spaces