Bummer! You must be logged in to access this page.

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

Core concepts of python

Could someone explain a little about the basics of python eg dictionaries lists tuples etc. I have done them but fining it hard to understand some of it. Any part explained would be great.

2 Answers

I'll try and give a basic explanation of tuples, lists and dictionaries.

Lists - Lists are any sequence of other python objects (numbers, words, other lists, tuples, and many more). You can think of list just they way you think of them in the real world. Lists are written in pencil, and you can erase any item and write a new one in it's place, or just leave it out altogether.

Tuples - Tuples are just like lists with one exception. Tuples are written in marker, so you can never change any of their values. The best you could do is to copy them to a brand new tuple, and as you are making the new one, make any changes you would want.

Dictionaries - Dictionaries work like having a filing cabinet with folders that display a way to know what their contents are. The label you can easily see is the dictionary key, the things inside the folder, which you cannot see without pulling open the folder are that key's value. If you want to know what value is in some folder, you have to know that folders key (it's label in this example). If you do not know it, you will have to spend a long time going through each and every folder looking for it until you find it.

Thanks for that Matthew wonder could u explain enumeration. Would be great