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 trialfl6
6,900 Pointsstuck no answers available for this
I cant figure this one out
best=["apple","peach","mango"]
best.extend=["banana","cherry"]
3 Answers
KRIS NIKOLAISEN
54,972 Pointsextend is a method. try:
best.extend(["banana","cherry"])
fl6
6,900 Pointsthis has not passed
my question is best has 2 items if counting 0,1,2
first line add another item, still didn't accept
fl6
6,900 Pointsis this a trick question, as the counting asks for 3 but python counts from 0?
how many subjects do you need in the first line? and the second line? recap([, bracket and square bracket? string and list?
KRIS NIKOLAISEN
54,972 PointsIn your original post best has three items. Each word is an item. 0,1,2 are indexes for items 1,2,3.
I tried the following and it passed:
best=["apple","peach","mango"]
best.extend(["banana","cherry"])
fl6
6,900 Pointsfl6
6,900 Pointsbest = ["car", "chocolate", "wine", "cars"]
best.extend(["banana", "cherry"])