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)
![Son-Hai Nguyen](https://secure.gravatar.com/avatar/9e9ebd5e6d534a414c04f9cb460df947?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Son-Hai Nguyen
2,481 Pointsprint ("there are" , len(attendees) , "attendees currently") is actually printing a list?
Hi guys,
I tried
print ("there are" + len(attendees) + "attendees currently")
and python gave me an TypeError: must be string bot integer. But how Craig changed the print function into
print ("there are" , len(attendees) , "attendees currently")
and it worked? is it in the () a list so that didnt care if it's an integer or a string?
Thanks guys.
3 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsThe "print" function can handle multiple comma-separated arguments that are different types.
But to perform concatenation with the "+" operator, the operands on both sides of it must be strings.
![Dan B](https://secure.gravatar.com/avatar/a04abfc47ab78e78419a2642cd87ba2a?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Dan B
6,155 PointsThere are also unnecessary spaces in your code.
The teacher's code was exactly:
print("There are", len(attendees), "attendees at the event")
Note that there are no spaces before the comma separators and no space after the print function. Also remember that using the addition sign means that you want python to add those parameters together. In this case you are trying to add a string and a function together with another string which will not work.
![Son-Hai Nguyen](https://secure.gravatar.com/avatar/9e9ebd5e6d534a414c04f9cb460df947?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Son-Hai Nguyen
2,481 PointsThanks Steven. I’ve just tried it in Maya Python and it returned the same error as well.