<jupyter_start><jupyter_text>Python; Iterations<jupyter_code>for i in range(10):
    print(i)
    print('hello')
for i in range(10):
    print(i)
for i in range(10):
    if i%2==0:
        print(i)
for i in range(3,10):
    print(i)
for i in range(0, 10, 2):
    print(i)
a = 0
constant = 5
for i in range(10):
    a = a + constant
    print("Value of a at step", i, "is", a)
print("This is the final value of a", a)
x = [12, 43, 4, 1, 6, 343, 10]
for item in x:
    print(item)
fruits = ['apple', 'orange', 'banana', 'grapes', 'pineapple']
for fruit in fruits:
    print(fruit)
num_list = [34, 12, 93, 783, 330, 896, 1, 55]
total = 0
for i in num_list:
    total += i
    print("Total at step",i, "is", total)
    
print('\n')
print("The final total is ", total)
data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
new_list = []

for item in data:
    new_list.append(item**2)
print(new_list)
x = {'key1': 100 , 'key2': 200 , 'key3': 300}
for key in x.keys():
    print(key)
for value in x.values():
    print(value)
for key, value in x.items():
    print("For ", key, " the value is: ", value)
ages = {'Brian':23, 'Amy':22, 'Darlene':47, 'Ralph': 32, 'Jordan':28, 'Stephanie':35}
for name, age in ages.items():
    print(name, "is", age, "years old.")
i = 0
while i<10:
    print("Hello")
    print(i)
    i = i+1
i = 0
while i<10:
    print("Hello")
    print(i)
    i = i+3
word = "IRONHACK"
i = 0
while i < len(word):
    print(word[i])
    i=i+1
word = "IRONHACK"
for i in range(len(word)):
    print(word[i])<jupyter_output>I
R
O
N
H
A
C
K<jupyter_text>Exercises  1.1<jupyter_code>for i in range(10,30):
    print(i)
for i in range(10,30,3):
    print(i)<jupyter_output>10
13
16
19
22
25
28<jupyter_text>1.2<jupyter_code>for i in range(10,30):
    if i%5==0:
        print(i)<jupyter_output>10
15
20
25<jupyter_text>1.3<jupyter_code>for i in range(1,6,2):
    print("*"*i)<jupyter_output>*
***
*****<jupyter_text>1.4<jupyter_code>space = 2
for i in range(1,6,2):
    print(space*" ",i*"*")
    space = space - 1<jupyter_output>*
  ***
 *****<jupyter_text>1.5<jupyter_code>import math
a = int(input("Please enter an interger: "))
result = 1
for a in range(2,a+1):
    result = result*a
if result == math.factorial(a):
    print("Factorial is ", result)
    print("The answer is correct")
else:
    print("Your answer is not correct")<jupyter_output>Please enter an interger: 8
Factorial is  40320
The answer is correct<jupyter_text>Exercise; Iterations on Lists  2.1<jupyter_code>x = [12, 43, 4, 1, 6, 343, 10, 34, 12, 93, 783, 896, 1, 55]
for item in x:
    if item%3==0:
        print(item)<jupyter_output>12
6
12
93
783<jupyter_text>2.2<jupyter_code>output_list = []
for item in x:
    item = str(item)
    last_digit = item[-1]
    if last_digit == '3':
        output_list.append(item)
        print(item)<jupyter_output>43
343
93
783<jupyter_text>2.3<jupyter_code>min(x)<jupyter_output><empty_output><jupyter_text>2.4<jupyter_code>max(x)<jupyter_output><empty_output><jupyter_text>Exercises: Iterations on Dictionaries  3.1<jupyter_code>word_freq = {'love': 25, 'conversation': 1, 'every': 6, "we're": 1, 'plate': 1, 'sour': 1, 'jukebox': 1, 'now': 11, 'taxi': 1, 'fast': 1, 'bag': 1, 'man': 1, 'push': 3, 'baby': 14, 'going': 1, 'you': 16, "don't": 2, 'one': 1, 'mind': 2, 'backseat': 1, 'friends': 1, 'then': 3, 'know': 2}
for word, freq in word_freq.items():
    if freq < 3:
        print(word)<jupyter_output>conversation
we're
plate
sour
jukebox
taxi
fast
bag
man
going
don't
one
mind
backseat
friends
know<jupyter_text>3.2<jupyter_code>frequencies = list(word_freq.values())
max_freq = max(frequencies)
for word, freq in word_freq.items():
    if freq == max_freq:
        print(word)<jupyter_output>love<jupyter_text>Snail and Well<jupyter_code>import numpy as np
np.mean(daily_climb)
def avg_speed():
    avg_sp = np.mean(daily_climb)
    avg_sp = round(avg_sp,1)
    return avg_sp
avg_speed
print(avg_speed)<jupyter_output><function avg_speed at 0x7fb6f2808280>
{'fraction_non_alphanumeric': 0.16926952141057935, 'fraction_numerical': 0.06599496221662468, 'mean_word_length': 4.1371280724450195, 'pattern_counts': {'":': 2, '<': 47, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '13', 'dir': 'jupyter-structured-clean-dedup', 'id': '304462', 'license': 'MIT', 'n_tokens_mistral': 1896, 'n_tokens_neox': 1700, 'n_words': 445, 'path': 'Jupyter/Python ; Iterations.ipynb', 'repo_name': 'dchrobakjr/march_2022_test', 'size': '3970'}