Chapter 8 Key Terms
Across
- 2. Each character in a string has a specific index number, referencing it’s place in the string. Useful when counting specific characters in a string
- 4. Duplication operator, works with strings as well as lists
- 7. Operator that can be used to determine if one string is in another string
- 8. Method that returns a list containing the words in the string
- 9. Returns a copy of the string with all trailing whitespace characters removed. Trailing whitespace characters are spaces, newlines (\n), and tabs (\t) that appear at the end of the string.
- 11. Returns a copy of the string with all alphabetic letters converted to uppercase. Any character that is already uppercase, or is not an alphabetic letter, is unchanged.
- 12. Method that returns a copy of a string, where every occurrence of a specified substring has been replaced with another string
- 14. Method that determines whether a string ends with a specified substring
- 15. Method that works like the endswith method, but determines whether a string begins with a specified substring
- 17. Returns true if all of the alphabetic letters in the string are lowercase, and the string contains at least one alphabetic letter. Returns false otherwise.
- 20. Returns a copy of the string with all leading and trailing whitespace characters removed.
- 21. Returns true if all of the alphabetic letters in the string are uppercase, and the string contains at least one alphabetic letter. Returns false otherwise.
- 23. The char argument is a string containing a character. Returns a copy of the string with all instances of char that appear at the beginning of the string removed.
- 25. The char argument is a string containing a character. The method returns a copy of the string with all instances of char that appear at the end of the string removed.
- 26. Returns true if the string contains only alphabetic letters or digits and is at least one character in length. Returns false otherwise.
Down
- 1. In Python, meaning once something is created, it cannot be changed. Strings and tuples are immutable
- 2. will occur if you try to use an index that is out of range for a particular string
- 3. appending one string to the end of another string using the + operator
- 5. Returns true if the string contains only whitespace characters and is at least one character in length. Returns false otherwise.
- 6. Operator that can be used to determine if one string is not in another string
- 10. Method that searches for a specified substring within a string. The method returns the lowest index of the substring, if it is found. If the substring is not found, the method returns −1
- 13. Returns a copy of the string with all alphabetic letters converted to lowercase. Any character that is already lowercase, or is not an alphabetic letter, is unchanged.
- 16. Returns true if the string contains only numeric digits and is at least one character in length. Returns false otherwise.
- 18. Returns a copy of the string with all instances of char that appear at the beginning and the end of the string removed.
- 19. Returns a copy of the string with all leading whitespace characters removed. Leading whitespace characters are spaces, newlines (\n), and tabs (\t) that appear at the beginning of the string.
- 22. Returns true if the string contains only alphabetic letters and is at least one character in length. Returns false otherwise.
- 24. You can use slicing expressions to select a range of characters from a string