- String
- Sequence
- Traverse
- Index
- Offset
- Immutable
- Slice
- Be able to index strings
- Be able to print the characters in a string without using an index using for...in
- Be able to print the characters in a string using an index and a while loop
- Be able to print the characters in a string using an index and a for loop
- Be able to return the index of the first occurance of a character in a string
- Be able to count the occurrences of a character in a string
- Be able to do simple string formatting
- Be able to evaluate string slicing syntax
- word[0:1]
- word[2:5]
- word[5:]
- word[:5]
- word[:]
- Know how strings are sorted
- String comparison are done with the same relational operators as numbers
- They are based on their ASCII/Unicode values
- Blanks, tabs, and other white space come before all the printing characters
- Digits come before upper case letters
- Upper case letters come before lower case
- If everything else is equal then shorter beast longer. So "cat" would come before "catnip"
- Be able to use the
in
operator with strings
- file
- open
- close
- Be able to open a file and read it one line at a time.
- Be able to read to the the end of file
- Be able to read all the lines from a file and store them in an array of strings.
- List (in other languages "lists" are called "arrays")
- Mutable
-
Lists are a sequence
-
Lists are mutable
-
range function
- With one parameter (stop)
- With two parameters (start, stop)
- With three parameters (start, stop, step)
- Traversing lists with ranges and for
What sequence would be produced by
range(3,10,2)
?
-
What is a linear search?
-
What is a binary search?
- What condition must be true in order to use a binary search?
-
What does an O(N) growth rate mean?
-
What does and O(log n)growth rate mean?
-
What is an O(n2) growth rate mean? Why is it bad?