From 2fd07440e91de70c92d3fd224e7f266b19fe78c4 Mon Sep 17 00:00:00 2001 From: robertcrockett Date: Tue, 28 Jun 2022 15:33:35 -0400 Subject: [PATCH 1/5] 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 2/5] 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 3/5] 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 4/5] 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 5/5] 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.