├── .github └── workflows │ └── codeql-analysis.yml ├── LICENSE ├── README.md ├── exercise ├── 01_basics_print_and_variables.md ├── 02 │ └── exercise │ │ └── 02_exercise.md ├── 03 │ └── exercise.md ├── 04 │ └── exercise.md ├── 05 │ └── exercise.md └── solutions.md └── resources └── good_resources.md /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ main ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ main ] 20 | schedule: 21 | - cron: '15 7 * * 3' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | 28 | strategy: 29 | fail-fast: false 30 | matrix: 31 | language: [ ] 32 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] 33 | # Learn more: 34 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed 35 | 36 | steps: 37 | - name: Checkout repository 38 | uses: actions/checkout@v2 39 | 40 | # Initializes the CodeQL tools for scanning. 41 | - name: Initialize CodeQL 42 | uses: github/codeql-action/init@v1 43 | with: 44 | languages: ${{ matrix.language }} 45 | # If you wish to specify custom queries, you can do so here or in a config file. 46 | # By default, queries listed here will override any specified in a config file. 47 | # Prefix the list here with "+" to use these queries and those in the config file. 48 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 49 | 50 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 51 | # If this step fails, then you should remove it and run the build manually (see below) 52 | - name: Autobuild 53 | uses: github/codeql-action/autobuild@v1 54 | 55 | # ℹ️ Command-line programs to run using the OS shell. 56 | # 📚 https://git.io/JvXDl 57 | 58 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 59 | # and modify them (or add more) to build your code if your project 60 | # uses a compiled language 61 | 62 | #- run: | 63 | # make bootstrap 64 | # make release 65 | 66 | - name: Perform CodeQL Analysis 67 | uses: github/codeql-action/analyze@v1 68 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CodingForKids 2 | 3 | **I am teaching this program every Sat 10 AM EST - FREE of Cost** 4 | 5 | This repo contains all the materials that I have used to teach Computer Science (Computational Thinking Concepts and Approaches as well as Coding) to Kids (2nd Grade and up) in USA. I have started this program as an humble effort to teach kids fundamentals and concepts of Computer Science. 6 | 7 | ### Why did I chose to teach kids ? 8 | - Teaching Computer Science from an early age has many benefits. 9 | - The most important reason that I started teaching to kids is - for the longest time, I wanted to teach my son Computer related stuff esp. Programming. 10 | - When I introduced the facaniting world of programming to my Son at the age of 6 years using [Hello Ruby !](https://www.amazon.com/Hello-Ruby-Adventures-Linda-Liukas/dp/1250065003/ref=sr_1_1?s=books&ie=UTF8&qid=1428090470&sr=1-1&keywords=9781250065001) .. what I saw is burning curiosity and eagerness in him to learn new things. 11 | - Then the COVID-19 started and everyone's life was halted and confined between the 4 walls. 12 | - I thought that this is the best time for me to invest time and effort to teach my son - Coding ..esp. Block based programming because it is simple, engaging and helps develop critical thinking skills in kids. 13 | - Then I thought, why just my son should I teach .. why not the kids of my friends ? 14 | - It all started when I posted a message in my friend's group that I am planning to do a "Pilot" program on teaching Kids Computer Science. 15 | - All my friends applauded my idea and now I am teaching a group of 15 kids - from North East region (mainly US, Canada). 16 | 17 | ### Sponsors 18 | Yes, you read it right. With my initiative, there are sponsors that sponsor my small effort of teaching computational thinking and coding (esp in python) to 2nd graders and up. 19 | 20 | A huge THANK YOU from kids and myself to below sponsors : 21 | 22 | - [Pybites](https://codechalleng.es/bites/newbie) 23 | - They have sponsored their platform for **free** for all the kids that I am teaching. Thank you Bob Belderbos ([@bbelderbos](https://twitter.com/bbelderbos)) and Julian from Pybites! 24 | 25 | - [replit.com](https://replit.com/~) 26 | - This being remote program, kids were struggling with python syntax (esp spacking !). We were using google colab. I wanted a platform that allows sharing just like google docs where the remote person can see what the other person is doing + you can start live thread for the code etc. 27 | - I reached out to Amjad Masad ([@amasad](https://twitter.com/amasad)) - CEO of replit.com. He was generous enough to offer their [education team suit](https://replit.com/site/teams) for **free**. 28 | 29 | -------------------------------------------------------------------------------- /exercise/01_basics_print_and_variables.md: -------------------------------------------------------------------------------- 1 | :notebook_with_decorative_cover: use [google colab](https://colab.research.google.com/) 2 | 3 | 1. Print your name in the python interpreter window. 4 | 2. Print your favourite movie name. 5 | 3. Print the name of your school. 6 | 4. create appropriate variables for above 1,2 and 3 questions 7 | 5. print the varaiables created in question 4 8 | 6. Assign / store variables created in question 4 in a new variable. print the variable e.g. print(variable1+variable2+variable3) 9 | 7. There are 20 coins that you found when diving deep into an ocean. You found another 10 coins that were magical 10. When you came out of ocean, it seems that 3 coins were lost. Print how many total coins you have left. 10 | 8. Create two (2) variables and assign any number to each of them. Then print out : 11 | 12 | a. Add 2 variables 13 | 14 | b. Subtract 2 variables 15 | 16 | c. Multiply 2 variables 17 | 18 | d. Divide 2 variables 19 | 20 | e. Optional : if you want to practice more, create 3 variables and repeat a through d. 21 | 22 | 23 | :bulb: **Use variables to store values that we learned in class. Make sure to follow proper naming conventions when creating variables** 24 | 25 | -------------------------------------------------------------------------------- /exercise/02/exercise/02_exercise.md: -------------------------------------------------------------------------------- 1 | # f-strings 2 | 3 | When you try to mix data types e.g. string and int in `print()`, things get tricky. 4 | 5 | for e.g. if you try to print : 6 | ``` 7 | first_name = "your name" 8 | my_integer = 8 9 | print(first_name + ' is '+ my_integer+ ' years old') 10 | ``` 11 | 12 | **WHY ?** Because you are trying to mix data types - string with an integer. Just the `print()` statement is not *smart* enough to know this ! 13 | 14 | With **f-strings**, you can simply surround the objects in the `print()` function with `{}` and print will take care of handling the data types ! How cool is that !! 15 | 16 | Now you can just do (in our previous example) as 17 | 18 | ``` 19 | print(f"{first_name} is {my_integer} years old.") 20 | 21 | # the variables are surrounded by {} (squible or curly brackets) 22 | ``` 23 | f-strings are intelligent enough to figure out and handle the data types and you no longer need to use `+` signs ! 24 | 25 | ## Problem 1: 26 | 27 | use `f-strings` to print for below objects 28 | 29 | - year = 2014 30 | - month = "December" 31 | - name = "Lucky" 32 | 33 | The sentence to print : 34 | 35 | `Lucky was born in December 2014.` 36 | 37 | ## Problem 2: 38 | You go to a grocery store and purchase 3 items 39 | - item1 is apples, 40 | - item2 is bananas and 41 | - item3 is avacados 42 | 43 | print below sentence using `f-strings` 44 | 45 | `At the grocery store, I bought some apples,bananas and avacados` 46 | 47 | ## Problem 3: 48 | In the above problem, add quantities of each item 49 | 50 | - item1_quantity = 5 51 | - item2_quantity = 10 52 | - item3_quantity = 12 53 | 54 | print below sentence using `f-strings` 55 | 56 | `At grocery store, I bought 5 apples, 10 bananas and 12 avacados. I got total 27 items from grocery store !` 57 | 58 | Hint : use a total_items variable to add the quantities that you purchased. 59 | 60 | ## Problem 4: 61 | we learned today that you you can use `input` to ask and wait for user to input some data. e.g. 62 | 63 | `first_name = input("what is your first name?") ` 64 | 65 | The above will wait for the user to input their first name and then store that in `first_name` variable. 66 | 67 | with that in mind, write a program that takes 2 numbers as input and stores them in 68 | number1 and number2 variables. Then using `f-strings` print 69 | 70 | `variable = int(input("provide 1st number")) # this will store the number as "integer" (see int that we are using) in variable 71 | 72 | - The addition of the 2 numbers that you provided is ____ 73 | - The subtraction of the 2 numbers that you provided is ____ 74 | - The multiplication of the 2 numbers that you provided is ____ 75 | 76 | ## Problem 5: 77 | write a program with below variables 78 | ``` 79 | language = 'Python' 80 | rank = 1 81 | who = 'all students' 82 | kids_age = 7 83 | teacher_surname = 'Shah' 84 | ``` 85 | The output should be 86 | 87 | ``` 88 | Python is the world no 1 programming language, all students should start learning it from age 7 years old. 89 | And they all learn Python with Teacher Shah. 90 | all students enjoy learning Python, as Python is quite fun, and Teacher Shah is quite fun. 91 | ``` 92 | Hint : You can use multiple f-strings to print per line. 93 | 94 | 95 | -------------------------------------------------------------------------------- /exercise/03/exercise.md: -------------------------------------------------------------------------------- 1 | #### Problem 1: 2 | 3 | Write a program to print a multiplication table (a times table). At the start, it should ask the user which table to print. The output should look something like this: 4 | 5 | ``` 6 | Which multiplication table would you like? 7 | 5 8 | Here's your table: 9 | 5 x 1 = 5 10 | 5 x 2 = 10 11 | 5 x 3 = 15 12 | 5 x 4 = 20 13 | 5 x 5 = 25 14 | 5 x 6 = 30 15 | 5 x 7 = 35 16 | 5 x 8 = 40 17 | 5 x 9 = 45 18 | 5 x 10 = 50 19 | ``` 20 | 21 | #### Problem 2: 22 | 23 | Add something else to the multiplication table program. After asking which table the user wants, ask them how high the table should go. The output should look like this: 24 | 25 | (note: You can do this with the for-loop version of the program, the while-loop version, or both.) 26 | 27 | ``` 28 | Which multiplication table would you like? 29 | 7 30 | How high do you want to go? 31 | 12 32 | Here's your table: 33 | 7 x 1 = 7 34 | 7 x 2 = 14 35 | 7 x 3 = 21 36 | 7 x 4 = 28 37 | 7 x 5 = 35 38 | 7 x 6 = 42 39 | 7 x 7 = 49 40 | 7 x 8 = 56 41 | 7 x 9 = 63 42 | 7 x 10 = 70 43 | 7 x 11 = 77 44 | 7 x 12 = 84 45 | ``` 46 | -------------------------------------------------------------------------------- /exercise/04/exercise.md: -------------------------------------------------------------------------------- 1 | #### Number guessing game (April 24 2021) 2 | 3 | - The user needs to guess what that number is. (In other words, the user needs to be able to input information.) 4 | 5 | - If the user’s guess is wrong, the program should return some sort of indication as to how wrong (e.g. The number is too high or too low). 6 | 7 | - If the user guesses correctly, a positive indication should appear. (e.g. you got it correct) 8 | 9 | - Rules of Game : 10 | - To guess a number between 1 to 10 11 | - A player gets 3 chances 12 | 13 | - pseudo code 14 | 15 | ``` 16 | - use random module 17 | - infinite loop 18 | - variable for chances (remember to increment this everytime the answer is wrong) 19 | - pick number between 1 - 10 20 | - compare using if .. elif ... else for greater, less or equal 21 | - if chances are done, print - loose and the number what was chosen. 22 | - ask if user wants to play again 23 | - if N , then break out of loop 24 | ``` 25 | 26 | #### Concepts that are included 27 | 28 | - Random function / module 29 | - Variables 30 | - Integers 31 | - Input/Output 32 | - Print 33 | - While loops 34 | - If/Else statements 35 | -------------------------------------------------------------------------------- /exercise/05/exercise.md: -------------------------------------------------------------------------------- 1 | #### Python List and Tuple exercise 2 | 3 | #### 1. Given a tuple below, how to access 30 from the tuple 4 | 5 | >myTuple = ("Orange", [10,20,30],(5,15,25)) 6 | 7 | #### 2. Reverse a list in python 8 | 9 | Given myList = [100,200,300,400] 10 | 11 | expected output [400,300,200,100] 12 | 13 | #### 3. Write a program that will take 5 names as input. The input will be stored in a list. Print out the list. 14 | It should look similiar to below 15 | > Hint: use input() and append ! 16 | ``` 17 | Give me 5 names: 18 | name1 19 | name2 20 | name3 21 | name4 22 | name5 23 | 24 | You gave me ['name1','name2','name3','name4','name5'] 25 | ``` 26 | 27 | #### 4: Modify the above program so 28 | - the user can replace one of the names. 29 | - the user should be able to choose which name to replace and then type in the new name 30 | - finally display the new list as below: 31 | ``` 32 | Give me 5 names: 33 | name1 34 | name2 35 | name3 36 | name4 37 | name5 38 | 39 | You gave me ['name1','name2','name3','name4','name5'] 40 | You are allowed to replace one name. Which one you want to replace ? (1-5): 4 41 | New Name: name_New 42 | The new list is ['name1','name2','name3','name_New','name5'] 43 | ``` 44 | 45 | #### 5: Write a program to create a dictionary that lets you 46 | - add words and their defination 47 | - Look up them later 48 | - tell user if the word is not in dictionary. 49 | ``` 50 | Add or lookup a word (a / l)? a 51 | Give me a word : Gondal 52 | Type the defination : Place where Akshar deri is located 53 | Word added ! 54 | Add or lookup a word (a / l)? l 55 | Give me a word : Gondal 56 | Place where Akshar deri is located 57 | Add or lookup a word (a / l)? l 58 | Give me a word : Gadhda 59 | That word is not found in dictionary.. try adding that word! 60 | ``` 61 | -------------------------------------------------------------------------------- /exercise/solutions.md: -------------------------------------------------------------------------------- 1 | Below are the solutions to our class - CodingForKids: 2 | 3 | - [:notebook:Jan 23 - Class 18 - Codingforkids](https://colab.research.google.com/drive/1oioARU4XZPLmbz7Xz-beayrtPr37gJme#scrollTo=NZG1lzziFlIa) 4 | - [:notebook:Jan 16 - Class 17 - Codingforkids](https://colab.research.google.com/drive/1oioARU4XZPLmbz7Xz-beayrtPr37gJme#scrollTo=_lTYIytmDyrc) 5 | - [CodingForKids/exercise/05/exercise.md](https://github.com/TheRockStarDBA/CodingForKids/blob/main/exercise/05/exercise.md) - [ANSWER](https://replit.com/@kinjalkumarshah/Jan32020Exercise5listtupledictionary#main.py) 6 | -------------------------------------------------------------------------------- /resources/good_resources.md: -------------------------------------------------------------------------------- 1 | - [Why Should Kids Learn to Code?](https://codewizardshq.com/python-for-kids/) 2 | - [Euler Problems - pythonfiddle.com](http://pythonfiddle.com/) 3 | - [Practice Python](http://www.practicepython.org/resources-for-learners/) 4 | - [Visualize your python code](http://pythontutor.com/visualize.html#mode=edit) : Mostly useful for advance coders, but helpful to novice to understand how things work 5 | - [Github search to discover cool repos - python for kids](https://github.com/search?l=Python&p=2&q=python+problem+kids&type=Code) 6 | --------------------------------------------------------------------------------