<jupyter_start><jupyter_text>Let's start by making sure we have the code from the previous units loaded in our notebook. Either confirm that you have the following code in your notebook in Visual Studio Code, or run this code cell to make sure that we've brought this code over to this notebook.<jupyter_code>print("Artemis Rover Rock Scanner Starting")

basalt = 0
breccia = 0
highland = 0
regolith = 0
rockList = []

strPath = "rocks.txt"
fileObject = open(strPath)
line = fileObject.readline()
print(line)

rockList = fileObject.readlines()

for rock in rockList:
    print(rock)

fileObject.close()

def countMoonRocks(rockToID):
    global basalt
    global breccia
    global highland
    global regolith

    rockToID = rockToID.lower()

    if("basalt" in rockToID):
        print("Found a basalt\n")
        basalt += 1
    elif("breccia" in rockToID):
        print("Found a breccia\n")
        breccia += 1
    elif("highland" in rockToID):
        print("Found a highland\n")
        highland += 1
    elif("regolith" in rockToID):
        print("Found a regolith\n")
        regolith += 1

    return

for rock in rockList:
    countMoonRocks(rock)<jupyter_output><empty_output><jupyter_text>Let's start by printing the number of each type of rock we found. For example, to print the number of basalt rocks, run this code cell:<jupyter_code># TODO Add a print statement for the other types of rocks: breccia, highland and regolith
print("Number of Basalt: ", basalt)<jupyter_output><empty_output><jupyter_text>As you can see, we first output a string that tells the user what they'll see. Then we concatenate on the variable name that includes the number of basalt rocks we found.Do the same thing for the four types of rock variables we created. (Solution code is below if you get stuck).Next, let's provide some more general data, such as the type of rock that was the most and least common. In this case, we'll use the `max()` and `min()` functions that we learned about in a previous module in this learning path.Try to figure out what you need to do, but if you get stuck, read below for the answer:<jupyter_code># TODO Add other rock types to the "max" and "min" function calls
print("The max number of one type of rock found was:", max(basalt, ))
print("The minimum number of one type of rock found was:", min(basalt, ))<jupyter_output><empty_output><jupyter_text>Solution Code:<jupyter_code>print("Number of Basalt: ", basalt)
print("Number of Breccia: ", breccia)
print("Number of Highland: ", highland)
print("Number of Regolith: ", regolith)

print("The max number of one type of rock found was:", max(basalt, breccia, highland,regolith))
print("The minimum number of one type of rock found was:", min(basalt, breccia, highland, regolith))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08600999286224126, 'fraction_numerical': 0.0028551034975017845, 'mean_word_length': 4.288679245283019, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '112220', 'license': 'MIT', 'n_tokens_mistral': 868, 'n_tokens_neox': 835, 'n_words': 359, 'path': '3-count-moon-rocks/count_moon_rocks.ipynb', 'repo_name': 'abdulazeezoj/mslearn-intro-to-python-space-exploration', 'size': '2802'}