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()

Julie Egan
PLUS
Julie Egan
Courses Plus Student 703 Points

i know it sounds dumb for the pros but I'm stuck...no idea what I'm doing wrong

i know it sounds dumb for the pros but I'm stuck...no idea what I'm doing wrong, I thought it was a simple creating a new variable with that string :(

banana.py
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(';')
menu = 'Our available flavours are: {}.'.

4 Answers

stjarnan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
stjarnan
Front End Web Development Techdegree Graduate 56,488 Points

Hi Julie!

Guessing you're stuck on the second part of the challenge?

menu = "Our available flavors are: {}.".

Notice the dot you put aftet the string? Remove it, you don't need punctuation after your variables :)

Like this:

menu = "Our available flavours are: {}."

Does that help?

I would like to add a comment to your "I know it sounds dumb to you pros":

I work as a developer, and I want you to know that me and my colleagues get stuck all the time, it's part of the fun! Just learn to relax when you do get stuck, and tell yourself that all the developers out there get stuck, it's ok! I started my journey here at Treehouse too, and I failed at so many of the challenges at the beginning. Believe in yourself, because we have all been there and we know that you'll make it if you don't give up!

Jonas

Julie Egan
Julie Egan
Courses Plus Student 703 Points

hi Jonas thanks for your kind words, self studying hasn't been easy for me, sometimes a word of encouragement and support makes a lot of difference!! so thank you ever so much.

about the code...well I'm still stuck, I have tried so many ways but the right one seems to be lost to me :( have searched it on youtube and google and nothing, I get the same answer but it doesn't work in here, I will keep trying though, I want one day to look at this post and laugh. :)

stjarnan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
stjarnan
Front End Web Development Techdegree Graduate 56,488 Points

Did you try copying the second code snippet from my post? Compare that one to what you wrote and perhaps you can find out where you went wrong :)

Good luck!

available = "banana split;hot fudge;cherry;malted;black and white" sundaes = available.split(';') menu = ("Our available flavors are: {}." ).format(", ".join(sundaes))

Julie Egan
Julie Egan
Courses Plus Student 703 Points

thanks but I have tried that too and it doesn't work

Azizi Ali
PLUS
Azizi Ali
Courses Plus Student 1,049 Points

maybe you just put .format(sundaes) at the end of 'menu'

menu = 'Our available flavors are: {}.'.format(sundaes)

btw, you must spell "flavors", not "flavours".

Julie Egan
Julie Egan
Courses Plus Student 703 Points

Thanks but that's not the right one neither. Flavours it is how it spelled in my country...

Julie Egan
PLUS
Julie Egan
Courses Plus Student 703 Points

im laughing sooner than I thought!!! you were right!!! thanks stjarnan :)