<jupyter_start><jupyter_text>PlaygroundPrima lavagna virtuale per il corso Python<jupyter_code>a = 4 + 5
b = 3 + 2
print(a * b)<jupyter_output>45<jupyter_text>Funzioni<jupyter_code>def sm(s=[]):
    """
    This function calculates sum and mean
    @param: s is a list that...
    """
    a = 0
    for x in s:
        a += x
    try:
        m = a / len(s)
    except ZeroDivisionError:
        m = None
    return a, m
f1s, f1m = sm([6, 8, 9])
f2 = sm()
print(f1, f2)<jupyter_output>(6, 2.0) (0, None)<jupyter_text>Oggetti e classi<jupyter_code>a = 'Mastercobra'
dir(a)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13976705490848584, 'fraction_numerical': 0.03161397670549085, 'mean_word_length': 3.23943661971831, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '227490', 'license': 'MIT', 'n_tokens_mistral': 274, 'n_tokens_neox': 259, 'n_words': 62, 'path': 'playground.ipynb', 'repo_name': 'giuliakargina/mastercobra', 'size': '601'}