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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Caleb Hughes](https://secure.gravatar.com/avatar/641f77726f78db78f158740dd02798ed?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Caleb Hughes
904 PointsSyntax Error In "To" and "CC" Split
attendees = ["Ken", "Alena", "Treasure"] attendees.append("Ashley") attendees.extend(["James", "Guil"]) optional_invitees = ["Ben", "Dave"] potentional_attendees = attendees + optional_invitees print("There are", len(potential_attendees), "potential attendees currently."
to_line = ", ".join(attendees) cc_line = ", ".join(optional_invitees) print("to: " + to_line) print("cc: " + cc_line)
treehouse:~/workspace$ python meeting.py
File "meeting.py", line 8
to_line = ", ".join(attendees)
^
SyntaxError: invalid syntax
2 Answers
![omair qasim](https://secure.gravatar.com/avatar/219ee426232fb1206c04286c4b59ec09?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
omair qasim
Python Web Development Techdegree Student 137 Pointsattendees = ["Ken", "Alena", "Treasure"]
attendees.append("Ashley")
attendees.extend(["James", "Guil"])
optional_invitees = ["Ben", "Dave"]
potentional_attendees = attendees + optional_invitees
print("There are", len(potential_attendees), "potential attendees currently."
to_line = ", ".join(attendees)
cc_line = ", ".join(optional_invitees)
print("to: " + to_line)
print("cc: " + cc_line)
I have solve your problem. You can make two mistake that I am correcting now
- first on is parenthesis. In the print function or print line at the end you cannot add an parenthesis )
- Second one is you make mistake in len(potential_attendees) the spell is false. Now i am correcting this.
attendees = ["Ken", "Alena", "Treasure"]
attendees.append("Ashley")
attendees.extend(["James", "Guil"])
optional_invitees = ["Ben", "Dave"]
potentional_attendees = attendees + optional_invitees
print("There are", len(potentional_attendees), "potential attendees currently.")
to_line = ", ".join(attendees)
cc_line = ", ".join(optional_invitees)
print("to: " + to_line)
print("cc: " + cc_line)
hop now you understand your mistakes.
![Alexander Davison](https://uploads.teamtreehouse.com/production/profile-photos/4157542/micro_binary.jpg)
Alexander Davison
65,469 PointsIt is difficult to read your code, because you forgot to provide markdown (read the Markdown Cheatsheet below the answer box ), but I think you are missing a closing parenthesis on the first
print
statement.