Python for Kids: Your First Program

Welcome to Python for kids: your first program! Python is a friendly coding language that reads almost like English. In this KidsKod lesson you will write your first real code and make the computer talk back to you.

What is Python?

Python is used by scientists, game makers, and AI builders. Kids love it because the words are clear, like print and input.

How to start (easy options)

  1. Ask a parent to install Python from python.org, or
  2. Use an online editor like Trinket / Replit (with a parent).

Program 1: Hello, coder!

print("Hello, KidsKod coder!")
print("You just wrote Python!")

Run it. If you see the message, you succeeded.

Program 2: Talk to the computer

name = input("What is your name? ")
print("Nice to meet you, " + name + "!")
age = input("How old are you? ")
print(name + " is an awesome coder at age " + age)

Program 3: A tiny decision

color = input("Favorite color: ")
if color.lower() == "blue":
    print("Blue like the KidsKod sky!")
else:
    print(color + " is a cool choice!")

Mini challenges

  • Change the messages to be funnier
  • Ask for a favorite game and print a reply
  • Make a “secret password” check with if

What you learned

You used print, input, variables, and if statements. Next, draw with Python Turtle and turn code into art and games.

Next Post Previous Post
No Comment
Add Comment
comment url