Partner With us

Getting Started with Coding

Lesson 1/1 | Study Time: 20 Min

Lesson 1: What is Coding?

Objective: Understand what coding is and why it’s important. Get introduced to common programming languages and how code interacts with computers.


What is Coding?

Coding is the process of giving instructions to a computer to perform specific tasks. It’s like writing a recipe or a set of directions, where each step is an instruction the computer needs to follow exactly.

Imagine you’re trying to tell someone how to make a sandwich, but they have to follow your instructions without guessing or improvising. If you say, "Put peanut butter," they might put it on the table if you didn't specify "on the bread!" Coding works the same way; you need to be clear and precise.


Why Learn to Code?

Coding is used in everything from mobile apps and websites to medical devices and financial systems. Learning to code can help you create your own programs, solve problems, or even build the next popular app. And coding is fun! It’s about using logic to solve real problems.


Common Programming Languages

  • Python: Great for beginners, used in web development, data analysis, and AI.
  • JavaScript: Powers most of the interactive parts of websites.
  • Java: Often used in large systems like Android apps.
  • Scratch: A visual language, especially useful for younger learners.

For this course, we’ll use Python because it’s beginner-friendly, versatile, and widely used.


Practice Activity: Think Like a Programmer

Imagine you have to give instructions to someone to walk through a maze blindfolded. Try writing a set of clear, step-by-step directions that someone could follow without confusion. This exercise will help you think in "instructions" like a computer does.

Example:

  1. Step forward three steps.
  2. Turn left.
  3. Step forward two steps.
  4. If you hit a wall, turn right and move forward.

Lesson 2: Setting Up Python

Objective: Learn how to set up Python on your computer and write your first program.


Step 1: Installing Python

  1. Go to the Python website.
  2. Click on "Download Python" and choose the right version for your operating system (Windows, Mac, or Linux).
  3. Open the downloaded file and follow the installation instructions.

Step 2: Opening Python’s IDLE (Interactive Development Environment)

  1. Open Python by finding "IDLE" in your programs.
  2. Once IDLE opens, you’ll see a window that looks like this: >>>
  3. This >>> symbol is called the Python "prompt," where you can type commands and see instant results.

Step 3: Writing Your First Program

Let's start with a classic beginner program, called "Hello, World!"

  1. Type the following into IDLE and press Enter:
    python
    print("Hello, World!")
  2. You should see this output:
    Hello, World!

Explanation: The print function displays whatever is inside the parentheses on the screen. Here, it printed "Hello, World!" Try changing the text inside the quotes and running it again!


Exercise: Personal Greeting Program

Write a program that prints your name. For example:

python
print("Hello, my name is [Your Name]!")

Expected output: Replace [Your Name] with your actual name. This will get you familiar with using print to display messages.


Lesson 3: Understanding the Basics of Programming

Objective: Learn the basic building blocks of programming: variables, data types, and syntax.


Variables

A variable is like a container that stores information. Think of it as a labeled box that you can put something into, like a number or a word.


Creating Variables in Python

Try typing these examples in IDLE:

python
name = "Alice"
age = 15
height = 5.8
  • Here, name stores the text "Alice", age stores the number 15, and height stores the decimal number 5.8.
  • You can access these values anytime by typing the variable’s name.

Exercise: Store Your Own Information

Create variables that store:

  1. Your favorite color.
  2. The year you were born.

Example:

python
favorite_color = "blue"
birth_year = 2008

Data Types

Every piece of information in Python has a specific "type":

  • String: Text data, surrounded by quotes ("Hello").
  • Integer: Whole numbers (10, 2023).
  • Float: Decimal numbers (3.14, 5.8).

Try this:

python
message = "Coding is fun!"
age = 14
height = 1.65

Use type() to check the type:

python
print(type(message)) # Should print <class 'str'>
print(type(age)) # Should print <class 'int'>
print(type(height)) # Should print <class 'float'>

Basic Syntax

Syntax is the set of rules that define how programs are written and interpreted. Just like in English, a sentence needs correct grammar, code needs correct syntax.

Example: Notice how Python uses indentation and colons to organize blocks of code.


Module 1 Summary and Challenge

  1. Summary: You've learned the basics of coding, installed Python, and explored key concepts like variables and data types.
  2. Challenge: Write a program that introduces you with your name, age, and a fun fact about you.

This is just the beginning! The next lessons would introduce conditionals, loops, functions, and more.

NIE

NIE

Product Designer
3.00
Loyal User
Expert Vendor
Silver Classes
King Seller
Forums Top User
Loyal Writer

GDPR

When you visit any of our websites, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and manage your preferences. Please note, that blocking some types of cookies may impact your experience of the site and the services we are able to offer.