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 trial

Python Python Basics (Retired) Ins & Outs Ins & Outs

I keep getting "Oops! It looks like Task 1 is no longer passing." when I complete the Task 3

This keeps happening

name.py
name = ('Scott')
treehouse = ('Tree' + 'house')
email_greeting = (treehouse " loves " name)

2 Answers

Keerthi Suria Kumar Arumugam
Keerthi Suria Kumar Arumugam
4,585 Points

You are missing "+" in your third line. Correct it or take that line out and run the task again. You might be able to get through.

name = ('Scott')
treehouse = ('Tree' + 'house')
email_greeting = (treehouse + " loves " + name)
Frederick Pearce
Frederick Pearce
10,677 Points

Well, I thought parenthesis made your variables tuples, but as Chase pointed out, this is only true if there are commas, so Keerthi's answer should work, as does this

name = 'Scott'

treehouse = 'Tree' + 'house'

email_greeting = treehouse + ' loves ' + name

So, is it standard convention to leave out parenthesis when creating string variables, or is this a common choice?

Here is a link that addresses the issue of string in parenthesis versus a single element tuple with a string value:

http://www.pythonlearn.com/html-009/book011.html

Chase Swanson
Chase Swanson
Courses Plus Student 8,886 Points

Tupels will not form without commas separating the values

Chase Swanson
Chase Swanson
Courses Plus Student 8,886 Points

Frederick,

I am not sure what convention is exactly in regards to your question. You don't need parenthesis to set a string value to a variable, but technically it will work if you want to do it that way. Essentially adding parenthesis in a statement is affecting the orders of operation.

You do have to use parenthesis when you are passing a string to a function/method like print(), join(), split(), etc.

For now I would say do what makes the code easiest for you to read, but remain consistent.

In an upcoming section Kenneth Love will discuss PEP8 which evaluates convention and that would be a good time to investigate it.