UserPreferences

PythonDictionary


Question: How do I delete an element of a list? Answer: First, what is a list element? In the list [1,2,3], the first element, element #0 is 1, and the second element, element #1, is 2. To delete a list element, type

into your code.


Q: How do I find out how many elements are in a list? A: Use the built-in function

it returns the number of elements in a list.


Suggestion for microproject 2: the command

is a good way to tell your program when to stop checking elements of a list. this works because the last element of a list is element number len(list_name)-1.


It's really spooky and annoying if the word "None" appears in your program for what seems like no reason at all. The reason it's there is that you forgot to include the "return" command when defining a function. So the function has a definition but no output.
random.random() returns a random floating-point number between 0.0 and 1.0, not including the endpoints.
Q: How does Python represent TRUE and FALSE? A: I've put up a page: UsingBooleansInPython. (Ted)