Part II – Creation and use of Lists/Tuples

--Originally published at TC101 – Peaz Cooper

Well well well! First of all! Ask yourself the following questions:

Is it real that only god can create such a variety of organisms? Can we do the same with a use of lists? Have you seen Walter White? Together we will learn the answers to these awesome and mind-blowing questions!


Okay this is kinda cheating… but here’s a brief explanation from sthurlow that explains perfectly!

  • Lists are what they seem – a list of values. Each one of them is numbered, starting from zero – the first one is numbered zero, the second 1, the third 2, etc. You can remove values from the list, and add new values to the end. Example: Your many cats’ names.
  • Tuples are just like lists, but you can’t change their values. The values that you give it first up, are the values that you are stuck with for the rest of the program. Again, each value is numbered starting from zero, for easy reference. Example: the names of the months of the year.
  • Dictionaries are similar to what their name suggests – a dictionary. In a dictionary, you have an ‘index’ of words, and for each of them a definition. In python, the word is called a ‘key’, and the definition a ‘value’. The values in a dictionary aren’t numbered – tare similar to what their name suggests – a dictionary. In a dictionary, you have an ‘index’ of words, and for each of them a definition. In python, the word is called a ‘key’, and the definition a ‘value’. The values in a dictionary aren’t numbered – they aren’t in any specific order, either – the key does the same thing. You can add, remove, and modify the values in dictionaries. Example: telephone book.

So check out this page for information

Continue reading "Part II – Creation and use of Lists/Tuples"