<jupyter_start><jupyter_text>Snail and wellA snail falls at the bottom of a 125 cm well. Each day the snail rises 30 cm. But at night, while sleeping, slides 20 cm because the walls are wet. How many days does it take to escape from the well?TIP: http://puzzles.nigelcoldwell.co.uk/sixtytwo.htm  Solución<jupyter_code># Assign problem data to variables with representative names
# well height, daily advance, night retreat, accumulated distance

# in centimeters

well_height = 125
daily_advance = 30
night_retreat = 20
accumulated_distance = 0

# Assign 0 to the variable that represents the solution

days = 0

# Write the code that solves the problem

while accumulated_distance != well_height:
    accumulated_distance += daily_advance
    days += 1
    if accumulated_distance < well_height:
        accumulated_distance -= night_retreat
    else:
        break

# Print the result with print('Days =', days)

print("Days = ", days)<jupyter_output>Days =  11<jupyter_text>Goals1. Treatment of variables2. Use of loop **while**3. Use of conditional **if-else**4. Print in console  BonusThe distance traveled by the snail is now defined by a list.```advance_cm = [30, 21, 33, 77, 44, 45, 23, 45, 12, 34, 55]```How long does it take to raise the well?What is its maximum displacement in one day? And its minimum?What is its average speed during the day?What is the standard deviation of its displacement during the day?<jupyter_code># How long does it take to raise the well?

advance_cm = [30, 21, 33, 77, 44, 45, 23, 45, 12, 34, 55]

# What is its maximum displacement in a day? And its minimum?

displacement_cm =[]

for x in advance_cm:
    displacement_cm.append(x - 20)

print(displacement_cm)

print("Maximum displacement = ", max(advance_cm), "\n"
     "Minimum displacement = ", min(advance_cm))


# What is its average speed**?

average_progress = sum(advance_cm)/len(advance_cm)
print("Average progress = ", int(average_progress))<jupyter_output>[10, 1, 13, 57, 24, 25, 3, 25, -8, 14, 35]
Maximum displacement =  77 
Minimum displacement =  12
Average progress =  38<jupyter_text>Variance$$\sigma^2 = \frac{1}{N}\sum_{i = 1}^{N} (x_i -\mu)^2$$ Standard Deviation$$\sigma = \sqrt\sigma^2 = \sqrt{\frac{1}{N}\sum_{i = 1}^{N} (x_i -\mu)^2}$$<jupyter_code># What is the standard deviation of your displacement during the day?<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10575296108291032, 'fraction_numerical': 0.043570219966159056, 'mean_word_length': 4.591016548463357, 'pattern_counts': {'":': 0, '<': 12, '<?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': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '581189', 'license': 'Unlicense', 'n_tokens_mistral': 877, 'n_tokens_neox': 746, 'n_words': 283, 'path': 'snail-and-well/snail-and-well.ipynb', 'repo_name': 'fnau001/data-prework-labs', 'size': '2364'}