stoneskin

learning coding with Scratch , Python and Java

index

1 Getting Started With Python

1.1 What is Coding?

Fun Fact: Python is used by companies like Google and NASA!

1.2 Why Python?

1.3 Getting Started with Python

1.3.1 Install Python

  1. Go to the Python download page, download, and install Python 3.1x or newer.
  2. Windows users:
  3. Mac users:
  4. Check if Python is installed:
    • Open a command prompt (Windows: press Win + R, type cmd, and press Enter) or terminal (Mac).
    • Type python --version and press Enter. You should see the version number printed.
    • Type python and press Enter to start the Python shell.
    • Try typing 3+4 and press Enter. You should see the result 7.
    • Type exit() and press Enter to exit the Python shell.

1.3.2 Install a Python Editor

There are many Python editors available. Here are a few popular ones:

In this guide, we will use VS Code because it is easy to use, has many features, and supports not only Python but also other languages.

1.4 Your First Python Code

Let’s write your very first Python program!

# hello_world.py
# This line prints a message to the screen
print("Hello world!")

# This line asks the user for their name
name = input("What is your name?\n")

# This line prints a personalized greeting
print("Hi,", name)

Try it out! Write this code in your editor and see what happens.

Activity: Make It Your Own!

color = input("What is your favorite color?\n")
print("Wow!", color, "is a great color!")

References

Next Lesson