<jupyter_start><jupyter_text>Practicing basic string commandsThis exercise is designed to give you practice using some of Python's basic string functionality.  Complete and run each code block following each set of directions.**Make sure you run each code field.  Each code field affects the fields that come after it.**[String Reference](https://nbviewer.jupyter.org/github/daveavis/python-help-notebooks/blob/master/python_strings.ipynb) for help. 1. Create a string variable that contains the string `Computer`.  Print the contents of your variable.<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>2. Create a string variable that contains the string `Science`.  Print the contents of your variable.<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>3. Using concatenation (the plus sign `+`), combine the two strings from the previous two parts into the string `Computer Science`.  Store this into a variable.  I will refer to this variable as `cs` in the upcoming exercises.  Print the contents of `cs`.<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>4. Print the first letter of the string in your variable `cs`. (Should be `C`)<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>5. Print the 9th letter of `cs` (Should be `S`)<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>6. Print the last letter of `cs` (should be `e`).  You must use a method that works for any string.  Do not use `cs[15]`.<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>7. Print the 3rd from last letter of `cs` (should be `n`).  You must use a method that works for any string.  Do not use `cs[12]`.<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>8. Print the length of `cs`. let python do the counting, do not count yourself. (should be 16)<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>9. Use `find` to locate the first occurrence of the letter "e" in `cs`.  Print this location (should be 6)<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>10. Use `rfind` to locate the last occurrence of the letter "e" in `cs`.  Print this location (should be 12)<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>11. Print the slice of `cs` from the 10th letter ('S') through and including the 12th letter ('i').  Output should be 'Sci'.  You may hardcode the starting and ending locations.<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>12. Print the slice of `cs` that contains `Computer`.  you may hardcode the starting and ending locations.<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>13. Print the slice of `cs` that contains `Science`.  You may hardcode the starting and ending locations.<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>14. Using slices (like the previous two exercises), print the `cs` string with the words swapped.  Output should be `Science Computer`.  You may hardcode the starting and ending locations.<jupyter_code># Your code goes here<jupyter_output><empty_output><jupyter_text>15. Without hardcoding starting and ending locations (other than the start or end of the string) use `find` to find the location of the space in `cs`, then use that location to print the `cs` string with the words swapped. Output should be `Science Computer`.<jupyter_code># Your code goes here<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08838243468593664, 'fraction_numerical': 0.010005558643690939, 'mean_word_length': 5.881453154875717, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '15', 'dir': 'jupyter-structured-clean-dedup', 'id': '286269', 'license': 'MIT', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1085, 'n_words': 439, 'path': 'strings_practice.ipynb', 'repo_name': 'daveavis/python-help-notebooks', 'size': '3598'}