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 (2015) Python Data Types Use .split() and .join()

i'm stuck with challenge 3

dont know if i shoul create a new string: new = sundaes.format(", ".join(available)) ????

Andreas Wassberg
Andreas Wassberg
5,856 Points

Mladen, det verkar som att det är bäst om du startar om från början med Python.

7 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,426 Points

You are very close. You are asked to alter menu by adding the formatting. Two ways to do this, reassign menu, or change the original assignment:

menu = "Our available flavors are: {}.".format(", ".join(sundaes))

## or ##

menu = menu.format(", ".join(sundaes))
Vittorio Somaschini
Vittorio Somaschini
33,371 Points

Hello Mladen.

No, you are not supposed to create a new variable.

Here you need to use the format method on the menu string that you have created in task two, and not on the sundaes variable. .format() inserts whatever is in parenthesis where the placeholders {} are. So, what I can see in your code is that your format method is very close to perfection (it still has a mistake in the parenthesis but it is also applied to sundaes, which is not what you need here.

Vitto

Hello Vittorio, do you mean something like this:

menu = menu.format()

/Mladen

Hi Chris, I actually tried the firs way that you suggest but it turned out to be wrong when i tried the code in the chllenge. But maybee i typed something in a wrong way? /Mladen

Vittorio Somaschini
Vittorio Somaschini
33,371 Points

Hello Mladen,

please provide your full code so that we can have a look.

Hello,

I actually missed (", ".). i wrote .format(join(sundaes)) so that's why i got it wrong

/Mladen

Ritesh R
PLUS
Ritesh R
Courses Plus Student 17,865 Points

Usually we miss the "." dot notation after the curly braces {} without the period symbol "." between the quotes right after the curly braces task 2 gets passed but not the final task 3! So be sure to add the "." as shown below.

menu = "Our available flavors are: {}".format(", ".join(sundaes))

#Correct Code below

menu = "Our available flavors are: {}.".format(", ".join(sundaes))