Across
- 5. Indexing refers to accessing an element within a sequence using its position within the sequence. In Python, indices start at 0 for the first element.
- 8. The `replace()` method returns a copy of the string where all occurrences of a specified old substring are replaced with a new substring.
- 11. In Python, the asterisk `*` is used as a repetition operator to repeat a sequence a specified number of times.
- 12. The `endswith()` method checks if a string ends with a specified suffix and returns `True` or `False`.
- 14. The `find()` method returns the lowest index in the string where a specified substring is found. If the substring is not found, it returns `-1`.
- 15. A sequence in Python is an ordered collection of items. Examples include lists, tuples, strings, and ranges.
- 17. The `isdigit()` method checks if all characters in a string are digits and returns `True` or `False`.
- 20. The `lstrip()` method removes any leading whitespace characters (space, tab, newline) from a string. If a character is specified (e.g., `lstrip(char)`), it removes leading characters that match the given character.
- 22. The `isalpha()` method checks if all characters in a string are alphabetic and returns `True` or `False`.
- 24. The `split()` method splits a string into a list of substrings based on a delimiter (default is any whitespace), returning the list.
- 25. The `islower()` method checks if all alphabetic characters in a string are lowercase and returns `True` or `False`.
Down
- 1. An object is considered immutable if it cannot be altered after creation. For example, strings and tuples in Python are immutable.
- 2. The `upper()` method returns a copy of a string with all characters converted to uppercase.
- 3. Concatenation is the operation of joining two sequences of the same type (like two strings or two lists) using the `+` operator.
- 4. An `IndexError` is raised when you try to access an index that does not exist within a sequence (e.g., accessing the 10th item in a list that only has 5 items).
- 6. Slicing is a way to obtain a subsequence from a sequence, specifying a start index and an end index (and optionally a step). The syntax is `sequence[start:stop:step]`.
- 7. The `rstrip()` method removes any trailing whitespace characters from a string. If a character is specified (e.g., `rstrip(char)`), it removes trailing characters that match the given character.
- 9. The `startswith()` method checks if a string starts with a specified prefix and returns `True` or `False`.
- 10. The `lower()` method returns a copy of a string with all characters converted to lowercase.
- 13. The `isspace()` method checks if all characters in a string are whitespace characters (e.g., space, tab, newline) and returns `True` or `False`.
- 16. The `isalnum()` method checks if all characters in a string are alphanumeric (a combination of alphabets and numbers) and returns `True` or `False`.
- 18. The `isupper()` method checks if all alphabetic characters in a string are uppercase and returns `True` or `False`.
- 19. The `not in` operator is used to check if an element does not exist within a sequence and returns `True` if it does not, `False` otherwise.
- 21. The `in` operator is used to check if an element exists within a sequence and returns `True` if it does, `False` otherwise.
- 23. The `strip()` method removes both leading and trailing whitespace characters from a string. If a character is specified (e.g., `strip(char)`), it removes both leading and trailing characters that match the given character.
