<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Safa Al-Siaudi</title>
    <description>The latest articles on DEV Community by Safa Al-Siaudi (@safaal28).</description>
    <link>https://dev.to/safaal28</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F843880%2Fc26c1366-d463-46b5-94a7-0291d08cabc5.jpeg</url>
      <title>DEV Community: Safa Al-Siaudi</title>
      <link>https://dev.to/safaal28</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/safaal28"/>
    <language>en</language>
    <item>
      <title>Introducing Kids to Coding</title>
      <dc:creator>Safa Al-Siaudi</dc:creator>
      <pubDate>Sat, 09 Apr 2022 00:22:32 +0000</pubDate>
      <link>https://dev.to/safaal28/introducing-kids-to-coding-3hm5</link>
      <guid>https://dev.to/safaal28/introducing-kids-to-coding-3hm5</guid>
      <description>&lt;p&gt;In 2019, I facilitated workshops for the &lt;a href="https://www.girlguides.ca/web/GGC/Parents/GGC/Parents/Parents.aspx?hkey=121ba496-5967-4f8a-ac2d-b15e967583ac" rel="noopener noreferrer"&gt;Girl Guides of Canada&lt;/a&gt; to introduce young girls to computer science and algorithmic thinking in a fun and playful way. While there are many resources online for beginner coders (&lt;a href="https://scratch.mit.edu/" rel="noopener noreferrer"&gt;Scratch&lt;/a&gt;, &lt;a href="https://code.org/" rel="noopener noreferrer"&gt;code.org&lt;/a&gt;, &lt;a href="https://www.codewars.com/" rel="noopener noreferrer"&gt;Codewars&lt;/a&gt;, among others), I've written below two offline tutorials that anyone can use to spark a kids interest and give them the confidence they need to pursue a career in technology if that's what they enjoy. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;em&gt;1. Decrypt the Secret Message&lt;/em&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learning objectives&lt;/strong&gt;: This activity is an introduction to cryptography where participants decrypt a secret message using Caesar Cipher.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Materials&lt;/strong&gt;: A secret message that has been encrypted and an encryption dictionary&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time&lt;/strong&gt;: ~ 15-20 minutes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Suggested age group&lt;/strong&gt;: 7-11 years old for activity A, 12-17 years old for activity B&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: This activity is split into two, both of which are of the same nature but activity B is slightly more difficult than activity A&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Activity A&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We have an &lt;em&gt;encrypted&lt;/em&gt; message that is written using numbers where each number represents a letter. Participants will &lt;em&gt;decipher&lt;/em&gt; the secret message by converting the number to its respective letter. A dictionary is given to participants indicating which number represents which letter. &lt;/p&gt;

&lt;p&gt;For example if A = 1, B = 2, C = 3, ...., Z = 26&lt;/p&gt;

&lt;p&gt;The secret message is written as follows:&lt;/p&gt;

&lt;p&gt;3 18 25 16 20 15 7 18 1 16 8 25&lt;/p&gt;

&lt;p&gt;which would be translated to:&lt;/p&gt;

&lt;p&gt;C R Y P T O G R A P H Y&lt;/p&gt;

&lt;p&gt;Messages can be of any length and can be full phrases to increase complexity level.&lt;/p&gt;

&lt;p&gt;You can ask the kids to create some secret messages of their own. Some examples of words they could encrypt are:&lt;/p&gt;

&lt;p&gt;C O M P U T E R S&lt;/p&gt;

&lt;p&gt;C H O C O L A T E&lt;/p&gt;

&lt;p&gt;I C E C R E A M &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Activity B&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here, participants will use a slightly more complex form of encryption called Caesar cipher. Caesar cipher is one of the oldest and most well known ciphers, named after Julius Caesar. The letters are swapped around so that nobody can understand your message except those who you intended to read&lt;br&gt;
the message.&lt;/p&gt;

&lt;p&gt;Participants will choose a number between 1 and 25 that will serve as a &lt;em&gt;key&lt;/em&gt; and each letter in the alphabet is shifted by that key. For example, if a group chooses the key 3, then their entire alphabet will become:&lt;/p&gt;

&lt;p&gt;X Y Z A B C D E F G H I J K L M N O P Q R S T U V W&lt;/p&gt;

&lt;p&gt;If a group wanted to write a secret message such as “SpiderMan is the best movie to ever exist” it would become&lt;/p&gt;

&lt;p&gt;VslghuPdq lv wkh ehvw prylh wr hyhu halvw&lt;/p&gt;

&lt;p&gt;Use the image below for participants to fill in the new alphabet based on the key. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5b5zbnngeadx9n8zreo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5b5zbnngeadx9n8zreo.png" alt="Dictionary"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, give students a secret message and a key. A secret message can be anything such as "Encanto" or "I love donuts". I created the handout below for participants.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3z8w6nbizrqtky4louem.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3z8w6nbizrqtky4louem.png" alt="Encrypted words"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once everyone has attempted the handout, you can take them up. The solutions are written below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9sc4fsz9tcp71hdsnnvs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9sc4fsz9tcp71hdsnnvs.png" alt="Decrypted Words"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the activity, you can debrief with the kids by asking the following questions: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;How does Caesar cipher work?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How can you imagine encryption to be used in the real world/on a day-to-day basis?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If someone is trying to decrypt your secret message and knows about Caesar ciphers, will they be able to easily understand the secret message?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can you think of any other way secret messages can be encoded?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;2. Go Turtle Go&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Materials&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A computer&lt;/li&gt;
&lt;li&gt;Python software downloaded onto the computer and an IDE (Integrated Development Environment)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you do not have Python downloaded, first download Python at python.org, then download the IDE &lt;a href="https://www.jetbrains.com/pycharm/" rel="noopener noreferrer"&gt;Pycharm&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Suggested age group&lt;/strong&gt;: 12-17 years old&lt;/p&gt;

&lt;p&gt;This introduces participants to programming on a computer using the programming language Python. If Python and Pycharm are already downloaded onto the computer, then no internet access is needed for the rest of the activity. In this exercise, we will use turtle.py which is a great introduction to programming where users get to see what they are doing. Visual programming allows first time users to enjoy programming by trial and error. Encourage participants to try and see what happens when using various instructions and to play around.&lt;/p&gt;

&lt;p&gt;If you use PyCharm as your IDE, choose “Create New Project”&lt;/p&gt;

&lt;p&gt;At the bottom of the page, click on Python Console.&lt;/p&gt;

&lt;p&gt;All code will be written next to the three arrows '&amp;gt;&amp;gt;&amp;gt;' which can also be referred to as the Python Shell. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvto3xirw6o1x4v3dvy0s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvto3xirw6o1x4v3dvy0s.png" alt="A screenshot of a Python Console next to a graphic opened by turtle.py that is a white screen with a small turtle in the center"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;import turtle&lt;br&gt;
ben = turtle.Pen()&lt;br&gt;
ben.shape(“turtle”)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;First, we import the turtle.py package, then assign an instance of turtle to any variable name (I named my turtle ben) and then we gave it a pen to draw. We then gave ben a turtle shape.&lt;/p&gt;

&lt;p&gt;Next, participants can draw anything with a few commands. For example if they wanted to draw a square, the participant would write:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ben.forward(100)&lt;br&gt;
ben.left(90)&lt;br&gt;
ben,forward(100)&lt;br&gt;
ben.left(90)&lt;br&gt;
ben.left(100)&lt;br&gt;
ben.forward(100)&lt;br&gt;
ben.left(90)&lt;/code&gt;&lt;br&gt;
To clear your screen:&lt;br&gt;
&lt;code&gt;ben.reset()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flle6a39bd2htxe2rwgbl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flle6a39bd2htxe2rwgbl.png" alt="A screenshot of a Python Console next to a graphic opened by turtle.py that contains a square"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The values inside two brackets is called a &lt;em&gt;parameter&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Participants can get really creative in what they code and create complex designs.&lt;/p&gt;

&lt;p&gt;To add colour, you could write &lt;code&gt;ben.color(“blue”)&lt;/code&gt; to make the lines blue. To draw a circle, you could write &lt;code&gt;ben.circle(100)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If participants want to step it up a level, they can make a spiral:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ben.speed(0)
for i in range(50):
  ben.circle(i*3)
  ben.left(10)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ava0ipgvcqmshrmbu78.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ava0ipgvcqmshrmbu78.png" alt="A screenshot of a Python Console next to a graphic opened by turtle.py that contains a spiral"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After participants are done, you can exit the program by clicking File and then Exit. You can talk to participants about how Python interprets instructions literally. In the tutorial we saw how instructions needed to be procedural and logical. For instance, when we drew a square we needed to turn left before going forward. You can ask the participants questions such as:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;What are some of the things you can draw using turtle?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How did your drawings change when you used different parameters?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How did  your drawings change when you put different numbers for speed()?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How did your drawings change when you put different numbers in a direction (e.g. left(), right(),forward())?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What kind of expressions did you use as parameters? E.g. while making a spiral, you could input &lt;code&gt;i*3&lt;/code&gt; as a parameter in &lt;code&gt;circle()&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What can turtle not do? &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>kids</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
