From 9e759ee2018544ddbb658bf1f3e3595e244d687b Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Mon, 18 Apr 2022 11:27:49 -0500 Subject: [PATCH 01/24] Change version --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 09e42bff..50f7404a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Master - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python 3.7 uses: actions/setup-python@v2 From d54569fea01d44ef7f7304ad5959437d6f21cc78 Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Mon, 18 Apr 2022 12:24:54 -0500 Subject: [PATCH 02/24] Trying deploy-pages --- .github/workflows/main.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 50f7404a..f64f9831 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,6 +29,9 @@ jobs: pip install mkdocs-material - name: Deploy - run: | - git pull - mkdocs gh-deploy + uses: actions/deploy-pages@v1 + # with: + # branch: master # The branch the action should deploy to. + # run: | + # git pull + # mkdocs gh-deploy From 36edb0d9720e25ee1ab6493047cc849d76a862d3 Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Mon, 18 Apr 2022 12:27:36 -0500 Subject: [PATCH 03/24] add github token --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f64f9831..84703f95 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,9 @@ on: pull_request: branches: [master] +env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + jobs: build: name: Build and Deploy Documentation From 0a282f9c20c7e0f8d1456e2997fb19e1b4a6d76b Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Mon, 18 Apr 2022 13:09:02 -0500 Subject: [PATCH 04/24] test permissions --- .github/workflows/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 84703f95..58382b77 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,9 @@ jobs: build: name: Build and Deploy Documentation runs-on: ubuntu-latest + permissions: + contents: 'read' + id-token: 'write' steps: - name: Checkout Master uses: actions/checkout@v3 @@ -31,6 +34,10 @@ jobs: python -m pip install --upgrade pip pip install mkdocs-material + - name: Check + run: | + pwd + ls -la - name: Deploy uses: actions/deploy-pages@v1 # with: From a4fab901afc81ce1cbcf8ca156384d0b726d75b2 Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Mon, 18 Apr 2022 13:11:03 -0500 Subject: [PATCH 05/24] Correct syntax --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58382b77..0fa04f3a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,8 +36,8 @@ jobs: - name: Check run: | - pwd - ls -la + pwd + ls -la - name: Deploy uses: actions/deploy-pages@v1 # with: From 8822fb0525bc30a2be2b43e0c7d9f91e24526d02 Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Mon, 18 Apr 2022 13:29:50 -0500 Subject: [PATCH 06/24] change depth --- .github/workflows/main.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0fa04f3a..4abcb8b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,6 +23,16 @@ jobs: steps: - name: Checkout Master uses: actions/checkout@v3 + - uses: actions/checkout@v2 + if: github.event_name == 'pull_request' + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.ref }} + + - uses: actions/checkout@v3 + if: github.event_name == 'push' + with: + fetch-depth: 0 - name: Set up Python 3.7 uses: actions/setup-python@v2 @@ -39,9 +49,8 @@ jobs: pwd ls -la - name: Deploy - uses: actions/deploy-pages@v1 # with: - # branch: master # The branch the action should deploy to. - # run: | - # git pull - # mkdocs gh-deploy + # branch: master # The branch the action should deploy to. + run: | + git pull + mkdocs gh-deploy From 61653385b64fdf744200a408095154837786f5f7 Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Mon, 18 Apr 2022 13:31:35 -0500 Subject: [PATCH 07/24] syntax issue --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4abcb8b7..7037a0f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,15 +21,16 @@ jobs: contents: 'read' id-token: 'write' steps: - - name: Checkout Master + - name: Checkout Branch uses: actions/checkout@v3 - - uses: actions/checkout@v2 + if: github.event_name == 'pull_request' with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.ref }} - - uses: actions/checkout@v3 + - name: Checkout Master + uses: actions/checkout@v3 if: github.event_name == 'push' with: fetch-depth: 0 From 779e8900656bf6b240d7e3263a87f3326b38e303 Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Mon, 18 Apr 2022 13:34:58 -0500 Subject: [PATCH 08/24] syntax --- .github/workflows/main.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7037a0f3..1d30014c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,17 +23,16 @@ jobs: steps: - name: Checkout Branch uses: actions/checkout@v3 - - if: github.event_name == 'pull_request' - with: - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.ref }} + if: github.event_name == 'pull_request' + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.ref }} - - name: Checkout Master - uses: actions/checkout@v3 - if: github.event_name == 'push' - with: - fetch-depth: 0 + - name: Checkout Master + uses: actions/checkout@v3 + if: github.event_name == 'push' + with: + fetch-depth: 0 - name: Set up Python 3.7 uses: actions/setup-python@v2 From 53a84d9340cfe7e35e9588bf4c951f86f6e40454 Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Mon, 18 Apr 2022 15:25:14 -0500 Subject: [PATCH 09/24] permissions --- .github/workflows/main.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d30014c..fe0fffb7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,16 +13,20 @@ on: env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} +permissions: + contents: 'read' + id-token: 'write' + pull-requests: 'write' jobs: build: name: Build and Deploy Documentation runs-on: ubuntu-latest - permissions: - contents: 'read' - id-token: 'write' + steps: - name: Checkout Branch uses: actions/checkout@v3 + with: + persist-credentials: false if: github.event_name == 'pull_request' with: fetch-depth: 0 @@ -30,6 +34,8 @@ jobs: - name: Checkout Master uses: actions/checkout@v3 + with: + persist-credentials: false if: github.event_name == 'push' with: fetch-depth: 0 @@ -43,6 +49,7 @@ jobs: run: | python -m pip install --upgrade pip pip install mkdocs-material + run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com' - name: Check run: | From 35525bcfae942a4baf92a497272e994c439d57c6 Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Mon, 18 Apr 2022 15:26:33 -0500 Subject: [PATCH 10/24] syntax --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe0fffb7..44a0c98a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,8 +25,8 @@ jobs: steps: - name: Checkout Branch uses: actions/checkout@v3 - with: - persist-credentials: false + with: + persist-credentials: false if: github.event_name == 'pull_request' with: fetch-depth: 0 @@ -34,8 +34,8 @@ jobs: - name: Checkout Master uses: actions/checkout@v3 - with: - persist-credentials: false + with: + persist-credentials: false if: github.event_name == 'push' with: fetch-depth: 0 From adf35cb8fd45324e440b09a651fd82f272088150 Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Mon, 18 Apr 2022 15:28:29 -0500 Subject: [PATCH 11/24] syntax --- .github/workflows/main.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 44a0c98a..c8372666 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,20 +25,18 @@ jobs: steps: - name: Checkout Branch uses: actions/checkout@v3 - with: - persist-credentials: false if: github.event_name == 'pull_request' with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.ref }} + persist-credentials: false - name: Checkout Master uses: actions/checkout@v3 - with: - persist-credentials: false if: github.event_name == 'push' with: fetch-depth: 0 + persist-credentials: false - name: Set up Python 3.7 uses: actions/setup-python@v2 From 2d69ce65b1608da90a6335675aa85723c1cde666 Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Mon, 18 Apr 2022 22:47:53 -0500 Subject: [PATCH 12/24] chg user --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8372666..c99ec1d5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} permissions: - contents: 'read' + contents: 'write' id-token: 'write' pull-requests: 'write' jobs: @@ -33,6 +33,7 @@ jobs: - name: Checkout Master uses: actions/checkout@v3 + if: github.event_name == 'push' with: fetch-depth: 0 @@ -47,7 +48,7 @@ jobs: run: | python -m pip install --upgrade pip pip install mkdocs-material - run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com' + git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com' - name: Check run: | From 266e883988aa6eab65ec1fa43b41de993fe0a5cf Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Tue, 19 Apr 2022 22:28:49 -0500 Subject: [PATCH 13/24] remove git commands --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c99ec1d5..00e8cc11 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,7 +48,7 @@ jobs: run: | python -m pip install --upgrade pip pip install mkdocs-material - git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com' + # git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com' - name: Check run: | From 8b5fab842ed39e791dce4cca4ec75a0d43d72340 Mon Sep 17 00:00:00 2001 From: Richa Singh Date: Thu, 21 Apr 2022 09:35:29 -0500 Subject: [PATCH 14/24] Remove commented code --- .github/workflows/main.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00e8cc11..efead2d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,8 +5,6 @@ name: Build Documentation using MkDocs on: push: branches: [master] - paths: - - '**.yml' pull_request: branches: [master] @@ -48,15 +46,12 @@ jobs: run: | python -m pip install --upgrade pip pip install mkdocs-material - # git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com' - + - name: Check run: | pwd ls -la - name: Deploy - # with: - # branch: master # The branch the action should deploy to. run: | git pull mkdocs gh-deploy From 285a2a2671bc38a286503dc62a8b8f9006b38ef5 Mon Sep 17 00:00:00 2001 From: Dan McCreary Date: Thu, 26 May 2022 11:44:52 -0500 Subject: [PATCH 15/24] updates to markdown content --- mkdocs.yml | 2 +- src/draw-for-squares-input-colors.py | 36 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/draw-for-squares-input-colors.py diff --git a/mkdocs.yml b/mkdocs.yml index 2a05bca5..0b1d4be1 100755 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -67,7 +67,7 @@ nav: site_description: 'Resources for teaching Python to CoderDojo Twin Cities students.' site_author: 'Dan McCreary' -repo_name: 'python' +repo_name: 'GitHub Repo' repo_url: 'https://github.com/CoderDojoTC/python' # CoderDojo Standards from here down diff --git a/src/draw-for-squares-input-colors.py b/src/draw-for-squares-input-colors.py new file mode 100644 index 00000000..c52d21f0 --- /dev/null +++ b/src/draw-for-squares-input-colors.py @@ -0,0 +1,36 @@ +# J.E. Tannenbaum +# Released: 11/10/2021 - Initial release +# 11/10/2021 - Cleaned up and added comments +# https://trinket.io/python/94326b4743 + +import turtle # Load the library +jet = turtle.Turtle() # Create the turtle object and name it +jet.shape("turtle") # Set the shape + +def drawIt(color, distance, angle): + jet.color(color) + jet.begin_fill() + jet.forward(distance) + jet.right(angle) + jet.forward(distance) + jet.right(angle) + jet.forward(distance) + jet.right(angle) + jet.forward(distance) + jet.end_fill() + +# Set the distance and angle variables +distance = 40 +angle = 90 + +colors = [] +for i in range(4): + color = input("Enter a color:") + colors = colors + [color] + +for color in colors: + drawIt(color, distance, angle) + +# We are done, so hide the turtle +jet.hideturtle() + From 2fd07440e91de70c92d3fd224e7f266b19fe78c4 Mon Sep 17 00:00:00 2001 From: robertcrockett Date: Tue, 28 Jun 2022 15:33:35 -0400 Subject: [PATCH 16/24] Updated several spelling mistakes --- docs/index.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/index.md b/docs/index.md index 78afbb62..7dd08d13 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,30 +1,30 @@ # CoderDojo Twin Cities Python Resources -This GitHub repository is for sharing teaching resources to teach Python. This includes hints on getting your Python environments setup up and extensive lesson plans for serveral enviornments. +This GitHub repository is for sharing teaching resources to teach Python. This includes hints on getting your Python environments setup up and extensive lesson plans for several environments. -Our mentors have used several different envornments for teaching Python. They each have pros and cons. What our mentors like is getting new students started using a graphical programming environment such as turtle graphics libraries. Here are some of our favorite tools: +Our mentors have used several different environments for teaching Python. They each have pros and cons. What our mentors like is getting new students started using a graphical programming environment such as turtle graphics libraries. Here are some of our favorite tools: - [**Trinket.io**](http://trinket.io) is an easy-to use, kid friendly web-based turtle graphics for beginners. - [**Jupyter Notebooks**](https://jupyter.org/) also have some support for turtle graphics. Jupyter Notebooks can be tricky to setup for the first time, but they are the perfect on-ramp for teaching data literacy. - [**Raspberry Pi**](https://www.raspberrypi.org/documentation/usage/python/) - The Raspberry Pi foundation has selected Python as its primary tool for teaching programming. If you have a Raspberry Pi there are many resources for you. Trinket and Jupyter Notebooks will also run on many Raspberry Pi devices. - **Robots** Our students love robots. Python is also the preferred language in many robotics courses. Today we teach beginning robotics with Scratch and Arduino, but we continue to investigate systems like Raspberry Pi robots that can be programmed with Python. Let us know if you have any low-cost kid friendly ideas. We have tested the JetBot and other robots and we continue to look for solutions. -Now lets briefly go into the pros and cons of these systems. +Now let's briefly go into the pros and cons of these systems. ## Learning Python with Trinket -We use the [trinket.io](http://trinket.io) web site to teach our introduction to python. Trinket has a nice turtle graphics library which is ideal for fast visual feedback. Because it is a free and a pure web web based environment it meets the criteria for our courses. There is no complex setup and each student can continue to do development when they are at home. The downside of Trinket is it has limited functionality, only supports Python 2.X in the free version and you must have an internet connection to use Trinket. If you need Python 3.X web +We use the [trinket.io](http://trinket.io) web site to teach our introduction to python. Trinket has a nice turtle graphics library which is ideal for fast visual feedback. Because it is a free and a pure web-based environment it meets the criteria for our courses. There is no complex setup and each student can continue to do development when they are at home. The downside of Trinket is it has limited functionality, only supports Python 2.X in the free version and you must have an internet connection to use Trinket. If you need Python 3.X web version you can use the free [repl.id](https://repl.it/) web site. ## Learning Python with Jupyter Notebooks -You can also use Jupyter Notebooks to draw turtle graphics. The notebook will open a new window to draw your turtle graphis. Getting Jupyter Notebooks is a bit tricky to setup on many PCs. However, once it is setup it offers tens of thousands of sample programs to learn python coding. Jupyter Notebooks are also the preferred tool by many data science professionals. +You can also use Jupyter Notebooks to draw turtle graphics. The notebook will open a new window to draw your turtle graphics. Getting Jupyter Notebooks is a bit tricky to setup on many PCs. However, once it is setup it offers tens of thousands of sample programs to learn python coding. Jupyter Notebooks are also the preferred tool by many data science professionals. An example of a Jupyter Notebook that uses turtle graphs is [here](jupyter/draw-figure.ipynb) ## Learning Python with Raspberry Pi -If you have a Rasperry Pi there are many great ways to learn Python. One of first things is to try out one of the Python development environments for the Raspberry Pi. +If you have a Raspberry Pi there are many great ways to learn Python. One of first things is to try out one of the Python development environments for the Raspberry Pi. ## Learning Python with Robots -Right now we are continuing to try to find the right combination of easy-of-use and low-cost robots to teach python. If you hear of any good tools, please let us know. +Right now, we are continuing to try to find the right combination of easy-of-use and low-cost robots to teach python. If you hear of any good tools, please let us know. ## Target Audience Learning Python is ideal for students that have good keyboarding skills. If students have difficulty with doing functions like copy and pasting text we suggest they start with a block-programming language like Scratch. @@ -32,7 +32,7 @@ Learning Python is ideal for students that have good keyboarding skills. If stu ## List of Concepts Here are some of the concepts we will be learning in this course. If you are already familiar with these concepts you can skip over some of the labs. -- **importing libraries** We need to tell Pyhton what functions we want to use. We will use the import function to tell Python which functions we need to use in our programs. +- **importing libraries** We need to tell Python what functions we want to use. We will use the import function to tell Python which functions we need to use in our programs. - **drawing** Turtle graphs has a set of drawing functions. We will learn to use these to draw patterns on the screen. - **square walk** - teach your turtle to walk in a square and draw figures. - **variables** Variables make our programs easier to read and easier to understand. @@ -41,7 +41,7 @@ Here are some of the concepts we will be learning in this course. If you are al - **functions** Functions allow us to break large programs into chunks that we can give names and can call over and over. - **function parameters** Functions can also take parameters to change the behavior of a function. - **random numbers** Random number functions allow our programs to have the computer select new random number between a range of numbers. -- **lists** Lists alow us to create collections of names. +- **lists** Lists allow us to create collections of names. - **inputs** Inputs allow us to prompt the user for values. - **recursion** Recursion allows us to have programs call themselves to create repeating patterns. - **modules** Once you have a group of related functions you can put them all together into a module. This makes it easier for others to reuse your programs. From 328345f436235a9790325563816b4b3f299876eb Mon Sep 17 00:00:00 2001 From: robertcrockett Date: Wed, 29 Jun 2022 09:01:05 -0400 Subject: [PATCH 17/24] Updated several spelling mistakes --- docs/trinket/02-simple-square.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/trinket/02-simple-square.md b/docs/trinket/02-simple-square.md index 97e63a1a..170e9f4d 100644 --- a/docs/trinket/02-simple-square.md +++ b/docs/trinket/02-simple-square.md @@ -28,11 +28,11 @@ Here is a link to the Trinket web site with this program running: [https://trinket.io/python/564899ffe9](https://trinket.io/python/564899ffe9) You can click on this link and then press the Run button. You should see the python code on the left side and the drawing on the right side of your screen. -## Explaination +## Explanation The first three lines will be the same for all our programs. They import the turtle library into our program, create a new turtle object and then assign the turtle a shape icon. Although almost all the turtle libraries work this way, there are some minor differences you will see in future examples. -## Reorinenting your turtle -Note that at the start, the turtle is facing to the right. After the last instruction, it is also facing to the right. This is a common best practice so that the turtle gets reoriented after some drawing function. If you remove the last right(90) function and run the program again you will see the turtle ends up facing upward. But if you rerun the progam you will still get the same square because the orientation of the turtle is not stored between runs. +## Reorienting your turtle +Note that at the start, the turtle is facing to the right. After the last instruction, it is also facing to the right. This is a common best practice so that the turtle gets reoriented after some drawing function. If you remove the last right(90) function and run the program again you will see the turtle ends up facing upward. But if you rerun the program you will still get the same square because the orientation of the turtle is not stored between runs. ## Experiments Can you change the distance and angle the turtle moves? What happens when you change the numbers for the forward and right functions? Can you go left as well as right? From 6dfde45eebde26c64c93a0520d5b6d884a28e135 Mon Sep 17 00:00:00 2001 From: robertcrockett Date: Wed, 29 Jun 2022 09:52:06 -0400 Subject: [PATCH 18/24] Updated to reflect octagon shape. Several typos updated as well. --- docs/trinket/04-loops.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/trinket/04-loops.md b/docs/trinket/04-loops.md index bcd3022e..61f1e745 100644 --- a/docs/trinket/04-loops.md +++ b/docs/trinket/04-loops.md @@ -28,5 +28,5 @@ dan.write('done with square') ## Experiments 1. Can you make the turtle draw a larger square? Hint: change the distance to be 80. How big can you make the square before the turtle goes off the screen? 2. Can you make a hexagon? This is a figure with six sides. Hint: the angle will need to be 60 and the range limit will need to be 6. -3. Can you make a hexagon? A Hexagon has eight sides. Hints: Try using an angle of 45. -4. Can you make a stop sign? You will need to use a dan.color('red'). a dan.begomfill() and a dan.endfill(). You can add the text of the word "stop" by using dan.moveto(x,y) and dan.write("STOP",None,None, "30pt bold"). You can also use the dan.hideturtle() so that the outline of the turtle is not displayed at the end. See: https://www.youtube.com/watch?v=HhxYt9Lskrw +3. Can you make an octagon? An Octagon has eight sides. Hints: Try using an angle of 45. +4. Can you make a stop sign? You will need to use a dan.color('red'). a dan.beginfill() and a dan.endfill(). You can add the text of the word "stop" by using dan.moveto(x,y) and dan.write("STOP",None,None, "30pt bold"). You can also use the dan.hideturtle() so that the outline of the turtle is not displayed at the end. See: https://www.youtube.com/watch?v=HhxYt9Lskrw From f21cde71afe9f55c44b0f4fc04b0699694c8cff6 Mon Sep 17 00:00:00 2001 From: robertcrockett Date: Wed, 29 Jun 2022 09:55:42 -0400 Subject: [PATCH 19/24] Used markdown to explicitly make youtube link a link --- docs/trinket/04-loops.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/trinket/04-loops.md b/docs/trinket/04-loops.md index 61f1e745..41bd796c 100644 --- a/docs/trinket/04-loops.md +++ b/docs/trinket/04-loops.md @@ -29,4 +29,4 @@ dan.write('done with square') 1. Can you make the turtle draw a larger square? Hint: change the distance to be 80. How big can you make the square before the turtle goes off the screen? 2. Can you make a hexagon? This is a figure with six sides. Hint: the angle will need to be 60 and the range limit will need to be 6. 3. Can you make an octagon? An Octagon has eight sides. Hints: Try using an angle of 45. -4. Can you make a stop sign? You will need to use a dan.color('red'). a dan.beginfill() and a dan.endfill(). You can add the text of the word "stop" by using dan.moveto(x,y) and dan.write("STOP",None,None, "30pt bold"). You can also use the dan.hideturtle() so that the outline of the turtle is not displayed at the end. See: https://www.youtube.com/watch?v=HhxYt9Lskrw +4. Can you make a stop sign? You will need to use a dan.color('red'). a dan.beginfill() and a dan.endfill(). You can add the text of the word "stop" by using dan.moveto(x,y) and dan.write("STOP",None,None, "30pt bold"). You can also use the dan.hideturtle() so that the outline of the turtle is not displayed at the end. See: [Python Stop Sign Tutorial](https://www.youtube.com/watch?v=HhxYt9Lskrw) From a081f2e0491ab211bd72bbb1d841fc9bf0897ac0 Mon Sep 17 00:00:00 2001 From: robertcrockett Date: Wed, 29 Jun 2022 10:10:49 -0400 Subject: [PATCH 20/24] Addressed python tabbing. Corrected several spelling issues. --- docs/trinket/05-conditionals.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/trinket/05-conditionals.md b/docs/trinket/05-conditionals.md index 0a316525..02c5eff8 100644 --- a/docs/trinket/05-conditionals.md +++ b/docs/trinket/05-conditionals.md @@ -10,7 +10,7 @@ Here is the basic syntax of the Python conditional operator. ```py if (i > 2): # do something if i is greater than 2 - else: +else: # do something else when i is exactly 2 or less than 2 ``` @@ -26,7 +26,7 @@ distance = 100 angle = 90 for i in range(1, 5): - # i modulo 2 is the remainer after we divide by 2 + # i modulo 2 is the remainder after we divide by 2 dan.write(i, font=("arial", 16, "normal")) if i > 2: # true if i greater than 2 dan.color('red') @@ -47,7 +47,7 @@ We would like every other side to change color. To do this we will add an if-th i % 2 ``` -In our previous loop lesson, we created an index that started at 1 and then changed to 2, 3 and finally 4. For 1 and 3, the first and third edges the result of divid by 2 will return 1 which is the same as TRUE. For 2 and 4 (the vertical sides of the square), the expression will evaluate to 0 since the remainder of 2/2 and 4/2 is zero. +In our previous loop lesson, we created an index that started at 1 and then changed to 2, 3 and finally 4. For 1 and 3, the first and third edges the result of divide by 2 will return 1 which is the same as TRUE. For 2 and 4 (the vertical sides of the square), the expression will evaluate to 0 since the remainder of 2/2 and 4/2 is zero. ```py import turtle @@ -69,7 +69,7 @@ for i in range(4): dan.write('done with square') ``` -[Conditinal Sqare](https://trinket.io/library/trinkets/5b18dc55c6) +[Conditional Square](https://trinket.io/library/trinkets/5b18dc55c6) Can you make the turtle use a larger pen size? Try dan.pensize(10) for the red and dan.pensize(3) for the blue. From 2273305674d6c860353c7d72c4a6ebd46d39e2c7 Mon Sep 17 00:00:00 2001 From: Dan McCreary Date: Thu, 3 Nov 2022 13:28:17 -0500 Subject: [PATCH 21/24] updates to markdown content --- docs/img/stop-sign.png | Bin 0 -> 9647 bytes docs/trinket/04a-stop-sign.md | 2 ++ 2 files changed, 2 insertions(+) create mode 100644 docs/img/stop-sign.png diff --git a/docs/img/stop-sign.png b/docs/img/stop-sign.png new file mode 100644 index 0000000000000000000000000000000000000000..504458ea5cecfa6f271aeb5990c230285da3e618 GIT binary patch literal 9647 zcmaJ{Wl$W<&%fia;_iBdqQ%_{2ORERtXOd?Zij1ecXyZKE~U`oR$Pk}DR8*FJYW7F z-w)X&yP2KI?j-Y@B$2AhvY2ROXaE2JQw|DIf8~|0RELWEy4rV2bG|a5tGcWtpmu`d z@Ku3W=*n3tDFK*YWmEt#+!}!RpUEqcy%GQb$_D~KuN?T_UOvMAPAl_4|C8(fGbD~z zd$ph^m4kfH^aP$5zDXw>ZV_v>TH*()nJ1WTK=^3c(jET$OVwu?PtWAdrM@*rZ_oU6+5QcN7R2g+P@M2caK`G$-*Tsj?WMazKJc zARk5+;h>(PDWOGziiqL@QX5BPsjy$6ZG3@^9?rh`b55hjXl__O>sIAMW*%XwrmY+c zZNDhVD>w!-C`b59lP4^<$ZufZrZfWQP(Sutp-cNXc74`(7eQfg?A!{FAR^(S)}Ofl zO>5Me-q#$}hIKxy?m(Du(M2q^R|PG0&q#*g#>(d!S zR(&(ma!l9kn=$(D>p?6=wds=Bb__2Cm~Rn|zmSg&>O#_%w#E~(<0iQ}qu>7#PJgxL zSnRY)sht7xd4DS*>W@IPMzj3#BrR#611PfMo+ACmsI>K)alBDLanGHg0aBlFf5kVw zep|M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#9_O}c_LGh{nD=f$dg*C?zwOS@wkT`V*zb1iJ5jK z5(L!blItasMVaqZ+-=cU1+51kqa|t$H@$;V!=M)!G`q!3b@u+fV!Q*;&-qn_OuO;YOs7D0yAMi80yi^$fx@kqvrOq z&5mUv&2^uTj`B0eOB0WP;zOEg@&$e(EfN26t6>!Ma&u6h4GBU~{c4m{TeD!EgooiC zX)uDG6KaDDuW)~3FX@CYbVeq=Sj_zo!@$lau%%o}Xrg_)zz(sN50nTepsSkEyQEy?{xW|B4Y_45tZ+DuHzcGxAXbkH-F|9ClG8BMypQ0mscyEOKEfi z+SkUT_z}n^#8H}MH|lCH6MxQc#J?K(N_Wxp!gDW`C91T$Yw25ti@VayAz???bZh1_ z2(B?^Z}`QLefq!-k;LSruQ0C4l20KYaLW@hFokxf@Bz zgeyk9cW_IsAT$(z8#v0+fbDJUzDKrkc1A zfhxE!Sas^3fPOgvE?t>2h=9nzWWpp`aS4IIb1{`b|0Bx5`#N$7i~AWEMrcAfOf>F1 z3m(-yu`$xJbk+8;pb&zSQnwiHcD5}yxv#|%Ej~t|+B7N)|NI(#_-e1?L@)p0nHMp2 zUc~>Vi7@{EX(9qu(6mxzB3d~bC~)%?{?K&DX{iIXOlfdlaS|qkze4_59LKNHcFV-| R!+*n4a?;9>T1k_j{{wb}4^sdD literal 0 HcmV?d00001 diff --git a/docs/trinket/04a-stop-sign.md b/docs/trinket/04a-stop-sign.md index ae2f13d8..76511db6 100644 --- a/docs/trinket/04a-stop-sign.md +++ b/docs/trinket/04a-stop-sign.md @@ -1,5 +1,7 @@ # Python Turtle Graphics Stop Sign +![](../img/stop-sign.png) + In this lesson, we will use variables and for loop to draw a stop sign. We will also show how to use the penup, pendown, color, begin_fill, end_fill and write functions. Our write function will also change the font size using the ```font=("Arial", 30, "normal")``` parameter. From 47ebaf093f30fc0c6b082e62cb353332909faeae Mon Sep 17 00:00:00 2001 From: dmccreary Date: Fri, 14 Apr 2023 23:17:58 -0500 Subject: [PATCH 22/24] updated content --- mkdocs.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mkdocs.yml b/mkdocs.yml index 65741107..5df4b057 100755 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -92,4 +92,10 @@ markdown_extensions: permalink: true plugins: - search +# Google Analytics Site ID: G-EP38Z3PVD5 +extra: + analytics: + provider: google + # https://analytics.google.com/analytics/web/#/p368752593/reports/intelligenthome + property: G-EP38Z3PVD5 From 8cbfdd5e8aab9b4643b2942c9c585c638c0a78e1 Mon Sep 17 00:00:00 2001 From: Dan Mccreary Date: Thu, 12 Sep 2024 16:23:26 -0500 Subject: [PATCH 23/24] updating content --- docs/strategy/index.md | 5 ++ docs/strategy/oder-of-concepts.md | 123 ++++++++++++++++++++++++++++++ mkdocs.yml | 4 +- 3 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 docs/strategy/index.md create mode 100644 docs/strategy/oder-of-concepts.md diff --git a/docs/strategy/index.md b/docs/strategy/index.md new file mode 100644 index 00000000..19f9a5e3 --- /dev/null +++ b/docs/strategy/index.md @@ -0,0 +1,5 @@ +# Teaching Strategies + +## Order of Concepts + +[Order of Concepts](oder-of-concepts.md) \ No newline at end of file diff --git a/docs/strategy/oder-of-concepts.md b/docs/strategy/oder-of-concepts.md new file mode 100644 index 00000000..bb443658 --- /dev/null +++ b/docs/strategy/oder-of-concepts.md @@ -0,0 +1,123 @@ +# Order of Concepts + +## Intro + +What is the role of visual feedback in teaching beginning Python? + +## No Visual Feedback + + +``` +What are the key concepts in learning Python for a 9th +grade student in the US? List the concepts in the order +they should be taught and add justification for ordering. +``` + +1. Introduction to Programming and Python + +Justification: Begin by explaining what programming is and how it allows us to communicate instructions to a computer. Introducing Python's simplicity and readability sets a positive tone for beginners. +2. Setting Up the Development Environment + +Justification: Before coding, students need to install Python and set up an Integrated Development Environment (IDE) or use an online coding platform. This ensures they're ready to practice coding examples. +3. Basic Syntax and Output with print() + +Justification: Learning how to display information is fundamental. The print() function is simple and provides immediate visual feedback, which is motivating for new learners. +4. Variables and Data Types + +Justification: Variables store information that programs manipulate. Understanding data types like integers, floats, strings, and booleans is essential for handling different kinds of data. +5. Basic Operators and Expressions + +Justification: Operators allow students to perform calculations and manipulate data. This includes arithmetic operators (+, -, *, /) and logical operators (and, or, not). +6. User Input with input() + +Justification: Allowing programs to accept user input makes them interactive. Learning to use the input() function helps students understand how to receive and process external data. +7. Conditional Statements (if, elif, else) + +Justification: Conditionals introduce decision-making in programs. They allow the code to execute different actions based on certain conditions, which is critical for dynamic programming. +8. Loops (for and while Loops) + +Justification: Loops enable code to be executed repeatedly without redundancy. Understanding loops is key for tasks that require iteration, like processing items in a list. +9. Lists and Basic Data Structures + +Justification: Lists store collections of items. Introducing lists teaches students how to handle multiple pieces of data efficiently. +10. Functions and Modular Programming - Justification: Functions promote code reusability and better organization. Learning to write functions helps students break down complex problems into manageable pieces. + +11. Introduction to Modules and Libraries - Justification: Python's strength lies in its extensive libraries. Teaching how to import and use modules like math or random expands the functionality available to students. + +12. Basic File Input/Output - Justification: Reading from and writing to files allows programs to handle data persistence. This is important for applications that need to save or load data. + +13. Error Handling with try and except - Justification: Errors are inevitable in programming. Learning to handle exceptions makes programs more robust and helps students debug their code effectively. + +14. Dictionaries and Sets - Justification: These data structures are useful for storing data in key-value pairs (dictionaries) and for handling unique items (sets). They broaden the ways students can manage data. + +15. Introduction to Object-Oriented Programming (OOP) - Justification: OOP introduces classes and objects, allowing for more complex and scalable code. A basic introduction prepares students for advanced programming concepts. + +16. Developing a Simple Project - Justification: Applying learned concepts in a project reinforces understanding. It provides practical experience and a sense of accomplishment. + +17. Review and Next Steps - Justification: Reviewing consolidates knowledge. Discussing next steps keeps students motivated to continue learning, possibly introducing topics like web development or data science with Python. + +By following this progression, students build a strong foundation in Python programming. Each concept builds upon the previous ones, ensuring a smooth learning curve tailored for 9th-grade students. + + +## With Visual Feedback + +``` +Now assume that all students have access to the +trinket.io website that allows students to learn +using turtle graphics to get fast visual feedback. +Generate a list of the key Python concepts and the +order they should be taught. +``` + +1. Introduction to Programming and Python + +Justification: Start by explaining what programming is and introduce Python as an accessible language for beginners due to its readability and simplicity. +2. Setting Up the Development Environment on Trinket.io + +Justification: Guide students on how to use Trinket.io for writing and running Python code, specifically leveraging its support for turtle graphics to provide immediate visual feedback. +3. Introduction to Turtle Graphics + +Justification: Begin coding with turtle graphics to engage students visually. Drawing simple shapes helps them understand basic programming concepts in an enjoyable way. +4. Basic Syntax and Turtle Commands + +Justification: Teach fundamental Python syntax through turtle commands like forward(), backward(), left(), and right(), which illustrate function calls and parameters. +5. Variables and Data Types + +Justification: Introduce variables to store values that control turtle movements (e.g., distances, angles). Cover basic data types like integers and floats in this context. +6. Loops with Turtle Graphics (for and while Loops) + +Justification: Use loops to create patterns and complex shapes, demonstrating iteration in a visually engaging manner. +7. Functions and Code Reusability + +Justification: Teach how to define functions to encapsulate code for drawing specific shapes or patterns, promoting modular programming and code reuse. +8. Conditional Statements (if, elif, else) + +Justification: Introduce decision-making by changing turtle behavior based on conditions (e.g., drawing different shapes based on user input). +9. User Input with input() + +Justification: Make programs interactive by allowing users to influence turtle drawings, enhancing engagement and understanding of input handling. +10. Lists and Data Collections - Justification: Teach lists by storing sequences of colors, movements, or shapes for the turtle to use, illustrating how to manage collections of data. + +11. Randomness and the random Module - Justification: Use the random module to add unpredictability to turtle drawings, making programs more dynamic and fun. + +12. Advanced Turtle Graphics Techniques - Justification: Explore advanced features like setting pen size, colors, filling shapes, and using loops to create intricate designs. + +13. Error Handling with try and except - Justification: Introduce error handling to make programs more robust, especially when dealing with user input that affects turtle actions. + +14. Introduction to Object-Oriented Programming Concepts - Justification: Provide a basic understanding of objects and classes by explaining that the turtle itself is an object with methods and attributes. + +15. Basic File Input/Output (Optional based on Trinket.io capabilities) - Justification: If supported, teach how to read from and write to files to save or load data that influences turtle drawings. + +16. Developing a Comprehensive Turtle Graphics Project - Justification: Apply all learned concepts in a final project where students create their own complex drawing or simple animation, reinforcing their skills and creativity. + +17. Review and Next Steps - Justification: Summarize the key concepts covered and discuss how these skills can be applied to other areas of Python programming, encouraging continued learning. + +By incorporating turtle graphics early and throughout the curriculum, students benefit from immediate visual feedback that enhances understanding and keeps them engaged. This progression builds foundational Python skills while leveraging the interactive capabilities of Trinket.io, providing a tailored and effective learning experience for 9th-grade students. + + + + + + + +``` \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 793dd168..eac9e91f 100755 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -59,7 +59,9 @@ nav: - Advanced Python: - Stock Ticker Analysis: advanced/stocks.md - MNIST Digit Prediction: advanced/mnist.md - + - Strategy: + - Introduction: strategy/index.md + - Order of Concepts: order-of-cocepts.,d - Contributing: - How to Contribute Examples: contribute.md - Contact: From 59d754ffd591c8b3f2108dfb8a12f75b70bb03b8 Mon Sep 17 00:00:00 2001 From: Dan Mccreary Date: Thu, 12 Sep 2024 16:23:56 -0500 Subject: [PATCH 24/24] updating content --- docs/strategy/{oder-of-concepts.md => order-of-concepts.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/strategy/{oder-of-concepts.md => order-of-concepts.md} (100%) diff --git a/docs/strategy/oder-of-concepts.md b/docs/strategy/order-of-concepts.md similarity index 100% rename from docs/strategy/oder-of-concepts.md rename to docs/strategy/order-of-concepts.md