<jupyter_start><jupyter_text>Chapter 6 Exercises  Exercise 5<jupyter_code>str = 'X-DSPAM-Confidence:0.8475'
atpos = str.find(':')
print(atpos)
flt = str[atpos+1:]
print(flt)
try:
    flt = float(flt)
    print(flt)
except:
    print('Not convertable to float.')<jupyter_output>0.8475<jupyter_text>Exercise 6<jupyter_code>help(str.casefold)
str1 = 'Emily'
str2 = 'EMILY'
str1 == str2
str1.casefold() == str2.casefold()
help(str.center)
title = 'Center the String'
title.center(25)
help(str.count)
title.count('e')
help(str.encode)
help(str.endswith)
title.endswith('g')
help(str.expandtabs)
help(str.format)
help(str.partition)
help(str.istitle)
help(str.join)
'_'.join(['last','name'])
help(str.lstrip)
help(str.rstrip)
word = ' Hello '
word.rstrip()
help(str.rjust)
word.rjust(25, '.')
help(str.translate)
help(str.zfill)
num = '399.99'
num.zfill(10)
help(str.replace)
word = "from"
new_word = word.replace('ro', 'or')
print(new_word)
help(str.swapcase)
word = 'hELLO'
word.swapcase()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18423645320197043, 'fraction_numerical': 0.030541871921182268, 'mean_word_length': 6.470588235294118, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '299690', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 459, 'n_tokens_neox': 441, 'n_words': 70, 'path': '06-exercises.ipynb', 'repo_name': 'trailmarkerlib/dataExplore', 'size': '1015'}