Category Archives: Learn to Code Sites

How to Use Parameters in Alice 2

ALice lets you create methods that use parameters. So , let’s look at how you can create and use them

 

Step 1 ) In an object’s method, click the “create parameter” button

create-parameter-button-alice

Step 2 ) Inside the method editor, use that parameter.  This often involves writing a loop , possibly something along the lines of the code below:

use-the-paramet-somehow

Step 3) Now you can call the method from another place like the world.myfirstmethod

call-the-the-method-from-another-place

 

 

You can even use an “object” as a parameter in Alice

 

via GIPHY

 

Learning Python for Hour of Code and Beyond

There are many ways to learn Python online these days. Following are just a few.

Penjee.com

Penjee teaches kids how to use Python in a visual and supportive way.  Unlike the other sites on this page, Penjee was made with scaffolding built into the fabric of its web curriculum. Students can see the “solution” if they are stuck on a particular challenge. If that is the case, they then have to try another, similar challenge, hopefully, having learned from seeing the solution code. They can then try a “Mike and Ike” version of the assignment.

Penjee Code Demo and Animation

 

Codecombat.com

codecombat-com-image

Code Combat teaches Python (as well as Javascript) through a video game. If you are a gamer, this might be your best choice. The site is based on a freemium model.

 

 

 

Codeacademy.com

Codeacademy is a text based interactive tutorial that teaches much of what Penjee or Code Combat teaches.  We put it on the bottom of the list because the site seems to emphasize syntax over understanding. While much of the site is great and easy to use, there are some parts that are not very forgiving and not very friendly for budding programmers. The most egregious example of this, IMHO, and at the time of this writing, is the “date and time section.” Below is a screenshot:

codeacademy-print-date-python

In this, you are asked to format the date. I can tell you, from experience, that many high school kids will get stumped here. Now, if you’ve done some programming,  you are probably familiar with the gist of this line.

But, why on earth would you ask a beginner to try to use byzantine syntax?

For a good reason, right? I mean, you wouldn’t put a “beginner,” which Codeacademy says this course is designed for, through this for nothing, right?

 

Wrong. Think again. Codeacademy does not seem to have a good reason.  Instead, students learn how to format dates . . . just for the fun of it. Alas, it’s just not too much fun, in and of itself 😉

codeacademy-python-date

 

 

If you have an exceptionally strong high school student, then, by all means, tell her or him to consider Codeacademy. However, we feel that you will learn at least as much from other sites that do not have some of the flaws found in Codeacademy’s Python course.

 

 

What does code.org studio do ?

Code.org’s studio suite is a fun and easy to use “blockly” code environment–like Scratch, there is no hand typing code. Instead, users drag blocks of instructions.

Example of Block of Code in Studio
Example of Block of Code in Studio

As anyone who has ever taught coding, before , hand typing code can be very frustrating and “blockly” coding like this consists of just dragging and dropping instructions . You can see an example of how it works in the picture below.

I have to hand it to code.org, it’s a very easy to use app, and almost doesn’t even need a tutorial!

 

 

 

Example of Code.org's Studtio In action

 

 

Learn_Python_Beginners

Learn to Program in Python with Codeacademy

Have you ever wondered how the popular websites like Google, YouTube, Pinterest, or Instagram work? You may be surprised. All these websites — despite their different functions, purpose, and design — were developed using one popular language: Python. With this powerful language, you can create everything from web apps and games to a search engine. This might seem like it would be a challenge, especially if you have no background in coding, but the New York based startup called Codeacademy has proven that people can master Python programming at home. With a strong commitment and a burning desire to learn, combined with the free Python course offered by Codeacademy, it will be easier than you thought. Moreover, they’ve transformed the boring learning process into an exciting online classroom where you can learn and code at the same time. Stuck? You can always get a hint or immediately ask for help. Start your first lesson today and, after just a few hours, you can even finish your first Python project!

Learn_Python_Beginners

Course Overview

  • Estimated course time: 13 hours.
  • Required technical level: Beginner (This means you can start to learn, even if you have never heard of Python before).
  • There are 12 units in the course.
  • Each part is designed to focus on a task with clear, detailed instructions and hints, if needed.
  • You can enter code and see the results in real time. The editor even color codes the text based on syntax.
  • If you get stuck, use a hint or ask the community for help.
  • You can refer to an online glossary containing a list of entries for your language when you forget something from the previous lessons.
  • After each theoretical part, you can apply your knowledge and skills with carefully designed exercises and small projects at the end of each unit.
  • Earn rewards in the form of badges.
  • After you finish a unit, Codeacademy will send a reminder with a clue as to which unit to complete next. You can disable these e-mails; however, they will constantly remind you to continue the course.
  • Interactive content and the ability to track your performance.
  • The course is free. However, Codeacademy recently added Codeacademy Pro, which is available for a monthly fee. Continue reading to learn more about this.
This is where it all begins
This is where it all begins

The Learning Process

screen 4

The Python course begins with Unit 1: Python Syntax. You are going to learn the basics of Python and even put your new skills to use with the project, “Tip Calculator.” Using all you learned about Python, you can create a simple calculator that shows the price of any meal when tax and tips are included. During each lesson, you’ll see the overview of what you are going to do, along with instructions for completion. There are three buttons to help when you are stuck: Hint, Q&A Forum, and Glossary.

Let’s have a look at how it works:

Step 1: You’ve finished eating in the restaurant and received the bill:

  • Cost of meal: $44.50
  • Restaurant tax: 6.75%
  • Tip: 15%

The first step of this project is to declare the variable meal.

Step 2: Create a variable for the tax percentage.

Step 3: Set the last variable for the tip.

Step 4: Now, when you have three variables, you need to assign them on one line and calculate the cost of the meal with tax.

Step 5: Here is the last step: you are going to count the total price. Done! You have ten lines of code, and you finished the first simple project in Python withinthe first hour or two of learning this language!

Screen 3

As you can see, Codeacademy introduced a whole new way of learning to code. They provided an excellent opportunity to apply new skills in real time, immediately after reading the necessary information. This, along with awesome exercises, projects, instant help, rewards, and much more, makes Codeacademy the number one place to go when you decide to learn Python and have no idea where to start.

Did you know? According to co-founder, Zach Sims, Python was the most requested language from the community. Now, it’s one of the most popular courses offered by Codeacademy with more than 2.5 million students enrolled.

Codeacademy Pro

Not long ago, Codeacademy introduced a new option called Codeacademy Pro. With this feature, you can learn even more about Python. Nearly every unit has extra resources that are available only to Pro users. For example, Unit 1 has four additional resources: from Python basics and built-in types to the final quiz to check what you’ve learned.

Moreover, you can submit the final Python project, which is to build an application using this powerful language, test it, and run it like a real developer! The new Pro option costs $59.99 a month. The core lessons, however, are still free and, hopefully, will stay free forever.

 

screen 5

 

If you enjoy working on projects, also check out Penjee.com–a fun way to teach kids python

 

What are Variables in Alice (alice.org)?

car-sign-object-alice

To Make a variable, click on the “Make a variable” button

variable-button-in-alice2

Then you have to decide on the type of variable

type-of-variables-in-alice

The “Big” Types of Variables

number = 3.1, 3  , 4.5

boolean = true or false

string = “abc”,   “3.1” ,   “&*(&^”, “true”, “false”, “  ” ”

strings are just things in quotes

 

alice-make-variable-example

 

In order to crete a variable, you click on the “create new variable” button , choose a type and , if you want , give it a value in the method editor.

how-to-create-variable-in-alice