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)
![Ian perry](https://secure.gravatar.com/avatar/17192b35bb4a0647e103b03dd2dee2a1?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Ian perry
2,674 Pointspython super lost on challenge split() join()?
Just can't seem to get my head round the code for task3 ? Any help explaining it would be great. Thanks :)
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(';')
menu = "our available flavors are: {}."
1 Answer
![Nathan Tallack](https://uploads.teamtreehouse.com/production/profile-photos/4003052/micro_NathanBusinessEditedSquare.jpg)
Nathan Tallack
22,160 PointsYou have done great. This is what they are looking for in the last step.
menu = menu.format(", ".join(sundaes))
What we are doing here is we are reassigning the menu value to be a new value. The new value is the exisitng vlaue modified with the string format method. That method will get your {}'s out of your string and replace it with the paramaeter you pass in. The parameter we pass in will be a string literal with a join method. The string literal in this case is ", " which is the "seperator" we will use when we call the join method. The join method takes your sundaes list in as a parameter. So the result will be a string which is all the values in that list seperated with the comman and space, and that will all be placed at the end of your menu string. :)
Ian perry
2,674 PointsIan perry
2,674 PointsHey Nathan Thanks for your help I have gone over the video loads of times and after stepping back and reading what you have put I feel I have a better understanding of .format() & .join() method. Need to keep practising tho Thank you again It was a great help. :)