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 trialJan Lundeen
5,886 PointsAdding a new string variable to display menu items - used join - received message that it's no longer passing
Hi,
Now I'm working on challenge task 2 of 3 under the split and joins section. I used the following code to display the menu items and created a variable called menu(see below). When I clicked recheck work, I got the message that "Oops! It looks like task 1 is no longer passing". I'm not sure what I did wrong. Any ideas? Thanks!
Jan
Let's add a new string variable for displaying our menu items. Make a new variable named menu that's set to "Our available flavors are: {}.".
banana.py
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
menu = "Our available flavors are:{}".format(";".join.available)
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
menu = "Our available flavors are:{}".format(";".join.available)
3 Answers
john larson
16,594 Pointsavailable = "banana split;hot fudge;cherry;malted;black and white"
# Use .split() to break the available string apart on the semi-colons (;)
# Assign this to a new variable sundaes
sundaes = available.split(";")
# Make a new variable named menu that's set to "Our available flavors are: {}."
menu = "Our available flavors are: {}." # <-- this is all they are asking here. You over shot a bit
Jan Lundeen
5,886 PointsThanks John! I didn't realize it was that simple. Sometimes, it's hard to know what they want.
Chad Josewski
1,824 PointsWhere in the course so far does it say anything about the # symbol?
john larson
16,594 PointsHi Chad. It looks like your right at the beginning of Python. The # symbol should come up soon. It's what we use in Python to add comments that won't be read as code.
Chad Josewski
1,824 PointsYeah.... I wrote this comment before I found out about that. Thanks.
john larson
16,594 Pointsjohn larson
16,594 PointsI have to agree, sometimes it is VERY hard to know what they want. Good luck with part three of this challenge, it catches a lot of people.