Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialmahdi messai
119 Pointspython strings quiz
Hello i was learning some python when i stumbled upon this quiz it should be like this
name = "mahdi"
subject = "Treehouse loves {}".format(name))
print(subject)
4 Answers
mahdi messai
119 PointsYou need to use a +
to combine the string and name
.
Still looking for an answer
Antonio De Rose
20,885 Pointsname = "mahdi"
subject = "Treehouse loves " + name
mahdi messai
119 Pointsthanks passed but was my code wrong ?
Antonio De Rose
20,885 Pointsjust as I mentioned earlier your code was right, see now, there are many ways in coding to solve a single same problem, you have solved in a way, but the question, over here has specifically, asked in a way, you have not done, otherwise, your coding is completely correct, except for that additional brace at the end.
mahdi messai
119 Pointsalright thank you
Antonio De Rose
20,885 PointsAntonio De Rose
20,885 Pointsgenerally speaking, your code would work, if you do like, as you did above except for the additional brace.
however, the given task, does not like, if you did it as such as it is asking you to use the concatenation operator