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 trialAmit Maurya
224 Pointspython I feel I m close but there is an error 'Did you use "," .join()'
I do 4 step correct but i think there is some bug in line 4 so pls help me to find out
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(';')
menu='Our available flavors are:{}'.format(','.join(available))
display_menu=sundaes
"," .join(display_menu)
menu='Our available flavors are:{}'.format(','.join(display_menu))
2 Answers
Steve Hunter
57,712 PointsHi there,
There are three things to change.
First, just leave in the first three lines of code - delete the others:
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(';')
menu = 'Our available flavors are:{}'.format(','.join(available))
Second, you want to join on a comma and a space - you've missed the space out. And, lastly, pass sundaes
into the join
method, not available
.
You end up with:
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(';')
menu = 'Our available flavors are:{}'.format(', '.join(sundaes))
Steve.
nakalkucing
12,964 PointsRemove these lines:
display_menu=sundaes
"," .join(display_menu)
menu='Our available flavors are:{}'.format(','.join(display_menu))
and put parenthesis around 'Our available flavors are:{}'.format(','.join(available))
on the menu line. Now menu is equal to what display_menu is supposed to be. Hope this helps, Nakal
nakalkucing
12,964 PointsAnd on the 'menu' line you have ', '.join(available) It should be ','.join(sundaes)
nakalkucing
12,964 Pointsnakalkucing
12,964 PointsThanks for answering. I worded my answer poorly. :)
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsI think you did fine - I just spotted your answer wasn't quite providing the full solution. We're all just trying to help so keep it up!
nakalkucing
12,964 Pointsnakalkucing
12,964 PointsThanks. :)