O'Reilly logo

Python For Kids For Dummies by Brendan Scott

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PROJECT 2

Hello World!

In Project 1, you install Python and fire up the interpreter. Project 2 gets you into Python proper, transforming you from an ordinary member of the public into a full Python programmer in training.

Tradition dictates that Hello World! be the first program that you write when you’re learning a new programming language. You’re following in the footsteps of many great programmers when you create this project.

In this project you see how to communicate information from the program to the user by making (outputting) a simple message. You see how Python remembers information and how you can name the information that you’ve asked Python to remember. This means you can reuse the information in other parts of your program.

image

You’ll see how Python makes its way through your programs, how to stop a program if it goes nuts, and how to make a program go a little nuts (to test how to stop it). Finally, check out some core program techniques (called loops), which you’ll use to cover the screen with greetings.

Write Hello World!

To create your Hello World! program, follow these steps:

  1. Open your Start menu and choose Python (command line).

    You pinned it to the menu in Project 1. You should get a prompt that looks like >>>.

    remember Code listings in this book are formatted in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required