<jupyter_start><jupyter_text>Interact Exercise 01  Import<jupyter_code>%matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display<jupyter_output>:0: FutureWarning: IPython widgets are experimental and may change in the future.<jupyter_text>Interact basics Write a `print_sum` function that `prints` the sum of its arguments `a` and `b`.<jupyter_code>def print_sum(a=0.0, b=0):
    print(a+b)<jupyter_output><empty_output><jupyter_text>Use the `interact` function to interact with the `print_sum` function.* `a` should be a floating point slider over the interval `[-10., 10.]` with step sizes of `0.1`* `b` should be an integer slider the interval [-8, 8] with step sizes of `2`.<jupyter_code>interact(print_sum, a=(-10.,10.,.1),b=(-8,8,2));
assert True # leave this for grading the print_sum exercise<jupyter_output><empty_output><jupyter_text>Write a function named `print_string` that prints a string and additionally prints the length of that string if a boolean parameter is `True`.<jupyter_code>def print_string(s, length=True):
    print(s)
    if length == True:
            print(len(s))<jupyter_output><empty_output><jupyter_text>Use the `interact` function to interact with the `print_string` function.* `s` should be a textbox with the initial value `"Hello World!"`.* `length` should be a checkbox with an initial value of `True`.<jupyter_code>interact(print_string,s='Hello World!',length=True);
assert True # leave this for grading the print_string exercise<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10457920792079207, 'fraction_numerical': 0.014232673267326733, 'mean_word_length': 6.1866666666666665, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '40486', 'license': 'MIT', 'n_tokens_mistral': 525, 'n_tokens_neox': 509, 'n_words': 175, 'path': 'Interact/InteractEx01.ipynb', 'repo_name': 'JAmarel/Phys202', 'size': '1616'}