+ 1
I created a variable with the it called as "name". I need to congregate it with a string before it and a string after it
code: print ("Enter name.") name = str(input()) print ("Hi!, my name is chatbot 1.0. Is "+ name" your name?") __________________________________________________________________ it shows "syntax error" in the print statement at the quotation mark at the start of the print statement..
2 Réponses
+ 2
Veera Ishaan You just need to concatenate the variable called name to “ your name?”
Like this:
print(“Hi!, my name is chatbot 1.0. Is “ + name + “your name?”
0
Veera Ishaan ,
Please add a Python tag to the discussion.
input() returns a string, so you don't need to convert it to a string.
# redundant
name = str(input())
# efficient
name = input()