Maintaining Order


Oops, try again. The new item should have been inserted at the index previously occupied by "duck".

don’t know i'm completely lost on this topic, dont remember doing any of this in the previous topics

Replace this line with your code. 

animals = ["aardvark", "badger", "duck", "emu", "fennec fox"]
duck_index = animals.index("duck")

print animals


Now that we have the index for "duck" cached, we can use list.insert() to insert "cobra":

    animals.insert(duck_index, "cobra")


Is there any book material out there that will help noobs. I just cant follow these instruction, there,s a sense you should have a good deal of programming back round before you do these courses, or should i have done a different course to start off with ?


I don't think it really matters which language you start with. Python has a huge codebase and once you start getting comfortable the learning becomes easier. The same can be said for any language. This course moves along a fairly brisk pace yet it only touches on each concept else it could take a year to complete.

Visit your local library and find books on the subject of computers, computer algorithms, programming concepts, logic, binary systems, etc. As far as books about Python, I do not have any suggestions.

There is ample documentation online for the language that should be close at hand as you pick up a new concept (usually a new keyword or function). Look them up right away and soon you'll have a feel of how they are presented.

Google (or any SE) is your friend. Use it first for everything, then turn to the forums once you have a bearing on your problem. And don't be afraid to start over, or go back to review. Work on the exercises repeatedly so you get used to typing code patterns. Soon your fingers will be doing half the programming work for you.

Install Python 2.7.2 in your local machine so you can become familiar with the interactive mode and IDLE editor. It's free and available from Python's site. Later on you can explore the paid for IDE's when they will be worth the investment. For now stick to IDLE. It's the one most everybody is familiar with.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.