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 trialvenkat bogadi
1,031 Pointskindly help me out regarding this
favorite_things = ['raindrops on roses', 'whiskers on kittens', 'bright copper kettles', 'warm woolen mittens', 'bright paper packages tied up with string', 'cream colored ponies', 'crisp apple strudels'] slice1=favorite_things[1:4] slice2=favorite_things[5:] soreted_things=favorite_things sorted_things.sort() please correct me if anything wrong
favorite_things = ['raindrops on roses', 'whiskers on kittens', 'bright copper kettles',
'warm woolen mittens', 'bright paper packages tied up with string',
'cream colored ponies', 'crisp apple strudels']
slice1=favorite_things[1:4]
slice2=favorite_things[5:]
soreted_things=favorite_things
sorted_things.sort()
Steven Parker
231,236 PointsJean y — funny!
But keep in mind that folks posting questions may be experiencing frustration and might not be the best audience for comedy. I learned that lesson myself when attempts to inject humor into my answers (which also contained helpful hints) were misinterpreted and resulted in complaints of "abrasive", "demeaning" or just "lacking empathy". Hopefully my experience will be of value to you also.
2 Answers
Steven Parker
231,236 PointsVery close! But I see two issues:
- you have "soreted_things" (with an extra "e") instead of "sorted_things"
- a simple assignment of a list makes a duplicate reference, but doesn't copy the list
Two easy ways to copy a list are using the ".copy()" method or a slice with no arguments ("[:]").
venkat bogadi
1,031 PointsThank you Steven...
Jean y
Java Web Development Techdegree Student 2,074 PointsJean y
Java Web Development Techdegree Student 2,074 Pointsthe problem is these are not your favorite things