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 trialMladen Rajkovic-Alvik
7,279 Pointsi'm stuck with challenge 3
dont know if i shoul create a new string: new = sundaes.format(", ".join(available)) ????
7 Answers
Chris Freeman
Treehouse Moderator 68,441 PointsYou 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
33,371 PointsHello 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
Mladen Rajkovic-Alvik
7,279 PointsHello Vittorio, do you mean something like this:
menu = menu.format()
/Mladen
Mladen Rajkovic-Alvik
7,279 PointsHi 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
33,371 PointsHello Mladen,
please provide your full code so that we can have a look.
Mladen Rajkovic-Alvik
7,279 PointsHello,
I actually missed (", ".). i wrote .format(join(sundaes)) so that's why i got it wrong
/Mladen
Ritesh R
Courses Plus Student 17,865 PointsUsually 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))
Andreas Wassberg
5,856 PointsAndreas Wassberg
5,856 PointsMladen, det verkar som att det Γ€r bΓ€st om du startar om frΓ₯n bΓΆrjan med Python.