LPTHW Exercise 34 - The most important thing to understand about this is that you can pluck out any item in a list, but you must remember that the first one is item “0” and not item “1.”.This version (0, 100), would run 100 times, except that I built in a “break.” Adding “range” allows you to make a different kind of “for” loop, with a limited number of times that it will run. We are sort (alphabetical order), pop() words off the ends, move words from one list to another. WHY DID WE SPLIT? By turning freetext into a list, we can examine it in all kinds of ways. Review LPTHW Exercise 25 and try to play with lists, using things you did in Ex.Just a quick hop forward to exercise 33 – we will come back to it later.NOTE: I’m skipping over Exercise 31 because it is just more of the same from Exercise 30.Note that when the condition is met, none of the other “elifs” after that are executed. Zed gives you lots of examples to play with. When you say IF with OR, you usually mean that only one of the things has to happen.Again, the way AND and OR work in programming languages is pretty much the same as the way we use them in real life. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |