<jupyter_start><jupyter_text>1. For Loop > for key word iteratate iterable objects such as string or list<jupyter_code>name = "Zhaokang"
for c in name:
    print(c.upper())<jupyter_output>Z
H
A
O
K
A
N
G<jupyter_text>2. Raising and Handling Exceptions<jupyter_code>def foo_with_exception():
    raise ValueError("This is an intentional error")
    
try:
    foo_with_exception()
except ValueError as err:
    print("({})".format(err))
else:
    print("No error. This should NOT be reached")<jupyter_output>(This is an intentional error)
{'fraction_non_alphanumeric': 0.1044776119402985, 'fraction_numerical': 0.0037313432835820895, 'mean_word_length': 5.033707865168539, 'pattern_counts': {'":': 0, '<': 7, '<?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': '639486', 'license': 'MIT', 'n_tokens_mistral': 195, 'n_tokens_neox': 192, 'n_words': 57, 'path': 'python_basics/Section4.ipynb', 'repo_name': 'zhaokany/python_notes', 'size': '536'}