<jupyter_start><jupyter_text>Variable Scope<jupyter_code>s = "some dumb string"

def func():
    print(s)

func()
def func2():
    s2 = "some dumb string"

func2()
print(s2)
def func3():
    s3 = "some dumb string"
    return s3

func3()
print(s3)
def func3():
    s3 = "some dumb string"

s3 = func3()
print(s3)
func3() is None
def func3():
    s3 = "some dumb string"
    return s3

s3 = func3()
print(s3)
s4 = "this is an outer string"

def func4():
    # re-define s4
    s4 = "this is the inner string"
    print(s4)

func4()
print(s4)
s5 = ["this is an outer string"]

def func5():
    # change s5
    s5.append("this is now modified")
    print(s5)

func5()
print(s5)
def multi_return_function():
    a = 5
    b = 12
    c = "a string"
    
    return a, b, c

multi_return_function()
my_a, my_b, my_c = multi_return_function()

print(my_a)
print(my_b)
print(my_c)<jupyter_output>5
12
a string
{'fraction_non_alphanumeric': 0.13540510543840178, 'fraction_numerical': 0.04550499445061043, 'mean_word_length': 3.2347417840375585, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '272482', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 386, 'n_tokens_neox': 380, 'n_words': 110, 'path': 'lectures/05-scope_classes/in-class-demo.ipynb', 'repo_name': 'lukethe18/ndap-fa2020', 'size': '901'}