<jupyter_start><jupyter_text>Basic For Loops II<jupyter_code>#Given a list, write a function that changes all positive numbers in the list to "big".



def big(d=[]):
    for i in range(len(d)):
         if d[i] >=0:
            d[i]="big"
    return d
big([-3,53,7,6])
            
##Given a list of numbers, create a function to replace the last value with the number of positive values.


def count_posative(d=[]):
    count =0 
    for i in range (len(d)):
        if d[i]>= 0:
            count+= 1
    d[len(d)-1]=count
    return d
    

    
count_posative([-1,1,1,1])
    
# Create a function that takes a list and returns the sum of all the values in the array.

def list_sum(d=[]):
    sum =0
    for i in range (len(d)):
        sum+= d[i]
    return sum


list_sum([1,3,2])    
#Create a function that takes a list and returns the average of all the values.

def list_avr(d=[]):
    sum =0
    for i in range (len(d)):
        
        sum+= d[i]
        
    return (sum/len(d))


list_avr([1,5,2])            
# Create a function that takes a list and returns the length of the list.


def length(d):
    return len(d)
length([1,2])
#Create a function that takes a list of numbers and returns the minimum value in the list. (Optional) If the list is empty, have the function return False.



def min(d):
    if len(d)<0:
        return False
    
    min=d[0]
    for i in range(len(d)):
        if d[i]< min:
            min = d[i]
    return min 
min([5,2,3])
    
#Create a function that takes a list and returns the maximum value in the array. (Optional) If the list is empty, have the function return False.


def ma(d):
    if len(d)<0:
        return False
    
    min=d[0]
    for i in range(len(d)):
        if d[i]< min:
            min = d[i]
    return min 
min([5,2,3])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11706783369803063, 'fraction_numerical': 0.018599562363238512, 'mean_word_length': 2.3014440433212995, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '384105', 'license': 'Apache-2.0', 'n_tokens_mistral': 645, 'n_tokens_neox': 626, 'n_words': 241, 'path': 'loobs_2.ipynb', 'repo_name': 'SarahAlhugail/intro_to_python-', 'size': '1828'}