<jupyter_start><jupyter_text>Computational Thinking*Lesson Developer: <NAME> <EMAIL>*<jupyter_code># This code cell starts the necessary setup for Hour of CI lesson notebooks.
# First, it enables users to hide and unhide code by producing a 'Toggle raw code' button below.
# Second, it imports the hourofci package, which is necessary for lessons and interactive Jupyter Widgets.
# Third, it helps hide/control other aspects of Jupyter Notebooks to improve the user experience
# This is an initialization cell
# It is not displayed because the Slide Type is 'Skip'

from IPython.display import HTML, IFrame, Javascript, display
from ipywidgets import interactive
import ipywidgets as widgets
from ipywidgets import Layout

import getpass # This library allows us to get the username (User agent string)

# import package for hourofci project
import sys
sys.path.append('../../supplementary') # relative path (may change depending on the location of the lesson notebook)
import hourofci


# load javascript to initialize/hide cells, get user agent string, and hide output indicator
# hide code by introducing a toggle button "Toggle raw code"
HTML(''' 
    <script type="text/javascript" src=\"../../supplementary/js/custom.js\"></script>
    
    <style>
        .output_prompt{opacity:0;}
    </style>
    
    <input id="toggle_code" type="button" value="Toggle raw code">
''')<jupyter_output><empty_output><jupyter_text>Use abstraction to hide detailsAs algorithms and computations get more *complex*, it can become difficult to keep track of all the details. This is where it can be helpful to utilize **abstraction** to help with computational thinking. If you can find a way to represent parts of an algorithm in a way that hides the details but still covers the entire computation, you can make things more **abstract** and have fewer things to think about. You have already seen an example of an abstraction when you looked at *visualizations*; we used pictures of trees instead of colors or numerals to represent the trees, so you did not have to think about which type of tree was represented by which color or which numeral.  We can also use *abstraction* when we build an algorithm, for example by grouping together steps and then using the group over and over. In this way we can pay attention to the details only once to create an *abstraction*, and then we do not have to pay attention to all of the details each time we want to use that abstraction.The example on the next page will take you through a forest fire algorithm that uses abstraction. Feel free to try it a few times to get a better idea of how it works.<jupyter_code>IFrame(src="supplementary/abstraction.html", width=900, height=610)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup