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 trialGeorge Lugo
Python Web Development Techdegree Student 922 Pointsmy code is still not working for some weird reason
def my_list[4,2,8,'John','george',[1,2]]
def my_list[4,2,8,'John','george',[1,2]]
1 Answer
Steve Hunter
57,712 PointsHi George,
If you delete the def
keyword and then assign your list to my_list
using an equals sign, that'll work fine.
Something like:
my_list = [ ... ] // your list looks fine
Steve.
Alexander Davison
65,469 PointsNote: You have to use a hash sign/pound sign # to make a comment in Python. In many other languages, you use // to make comments.
Steve Hunter
57,712 PointsYep. Fair 'comment'! Not sure how I managed to get that wrong since I've been writing in Ruby on Rails all day. Maybe I was wishing I was back in Java-land.
Cheers,
Steve.
Alexander Davison
65,469 PointsHaha. I'm probably almost the opposite; I'm familiar with Python (not 100% familiar with Ruby but pretty familiar) and new to Java.
Steve Hunter
57,712 PointsAt risk of getting the thread off-topic (Sorry, George, I hope you got this sorted in the end!), I've never used Python at all. My background is C++ & (the amazing) Smalltalk and then, more latterly, Java & RoR. I must branch out more, though. Although I find Rails very satisfying in getting big jobs done elegantly.
Alexander Davison
65,469 PointsCool! My first language I ever learned was Python. I learned it before Treehouse so when I joined Treehouse I was somewhat familiar with Python (and a little of Ruby and JS as well). When I joined Treehouse, I boosted my programming skills (Treehouse is incredibly amazing at teaching! ). Meanwhile, I was learning PyGame on my own because I loved video games so much. I found is wonderful; then in the future Treehouse released a new topic: Game Development. I was so exited, of course. I went into that topic and learned Unity3D. It was a very exciting adventure on Treehouse :)
Steve Hunter
57,712 PointsLet's chat off this thread! I have various contact methods in my profile.
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsGeorge Lugo
This is your 3rd question now for the same challenge within an hour or two. Others have tried to help you on your previous questions.
Are you reading those responses? Are you having trouble replying back to your original question to indicate that you need more help?