<jupyter_start><jupyter_text>Indexing - grab a single characterSlicing - grab a subsection of the string<jupyter_code>my_string = "<NAME>"
my_string
# indexing - lets grab 'o'
my_string[4]
# grab first 'l'
my_string[2]
# grab last letter of string -- FYI to grab last letter of any string use -1
my_string[-1]
# slicing - grab characters that = "World" -- FYI a space is counted as a charcter
my_string[6:]
# grab characters that = "Hello"
my_string[:5]
# lets grab characters = "llo Wor"
my_string[2:9]
# [start:stop:step]
my_string[::2]
# use step to jump through string
my_string[2:5:1]
# reverse string
my_string[::-1]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12116564417177914, 'fraction_numerical': 0.019938650306748466, 'mean_word_length': 5.219047619047619, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '105044', 'license': 'Unlicense', 'n_tokens_mistral': 241, 'n_tokens_neox': 234, 'n_words': 75, 'path': 'indexing_and_slicing.ipynb', 'repo_name': 'MarcusDMelv/Python', 'size': '657'}