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 Types and Branching If, Else and Elif

mohan Abdul
mohan Abdul
Courses Plus Student 1,453 Points

An extra closing perin ,""" ) """, with """ .format """ when the top box i.e text editor.

"""print('you should totally learn python {}!".format(first_name))""" in the previous videos we didn't use extra closing bracket when using .format. When in txt editor, the top box, the teacher uses an extra closing bracket? why? it wasn't practiced in previous videos when doing this in the console I.e bottom box - python shell or repl.

1 Answer

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

The extra parentheses ) is what closes the print method at the start of the statement, so this syntax is the correct one. :-)

If it's the conditional code blocks you're referring to generally in Python we don't add parentheses () for those.

Hope this helps you but let me know if you're still confused.