<jupyter_start><jupyter_text>Follow standard Python style in your code.* Use 4 spaces as indentation* Don't use 'from module import *' to import everything* Use parentheses to make statements clear* Use spaces to make code readable* Document your code with comments  Use docstrings to provide online help on your own functions* If the first thing in a function is a character string that is not assigned to a variable, Python attaches it to the function as the online help.* Called a docstring (short for “documentation string”).<jupyter_code>def average(values):
    "Return average of values, or None if no values are supplied."
    
    if len(values) == 0:
        return None
    return sum(values) / average(values)

help(average)
help(average)
#multi-line strings are allowed

def distance(gravity, time): 
    """Return distance travelled under constant acceleration from gravity
    
    gravity: acceleration due to gravity (m/s^2)
    time : time travelled (seconds).
    
    returns: distance travelled in metres."""

    return 0.5 * gravity * time**2

help(distance)<jupyter_output>Help on function distance in module __main__:

distance(gravity, time)
    Return distance travelled under constant acceleration from gravity
    
    gravity: acceleration due to gravity (m/s^2)
    time : time travelled (seconds).
    
    returns: distance travelled in metres.<jupyter_text>Exercise 1What does this program do? Re-write to make it more readable and re-usable. **Make sure it still works**. Compare your rewrite with your neighbours.    from math import *    n=10    r=10    x=[]    y=[]    for i in range(n):        x.append(r*cos(pi*i*2/9))        y.append(r*sin(pi*i*2/9))    print(x)    print(y)<jupyter_code>from math import *
n=10
r=10
x=[]
y=[]
for i in range(n):
    x.append(r*cos(pi*i*2/9))
    y.append(r*sin(pi*i*2/9))
print(x)
print(y)
from math import cos,sin
#Initialize variables
def make_circle(radius, number_of_points):
    x,y = [], []
    for i in range(number_of_points):
        theta = 2*pi*(i/(number_of_points-1))
        x.append(radius*cos(theta))
        y.append(radius*sin(theta))
    return x, y

x,y = make_circle(10, 10)
print(x)
print(y)<jupyter_output>[10.0, 7.660444431189781, 1.7364817766693041, -4.999999999999998, -9.396926207859083, -9.396926207859085, -5.000000000000004, 1.7364817766692997, 7.660444431189779, 10.0]
[0.0, 6.4278760968653925, 9.84807753012208, 8.660254037844389, 3.420201433256689, -3.4202014332566866, -8.660254037844384, -9.848077530122081, -6.427876096865396, -2.4492935982947065e-15]
{'fraction_non_alphanumeric': 0.10772833723653395, 'fraction_numerical': 0.12334113973458236, 'mean_word_length': 3.996101364522417, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '528749', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 1056, 'n_tokens_neox': 840, 'n_words': 268, 'path': 'notebooks/complete/15_Programming_Style.ipynb', 'repo_name': 'utplanets/PHY224PythonReview', 'size': '2562'}