Game Development Reference
In-Depth Information
Topics Covered In This Chapter:
— Integers and Floating Point Numbers
— Expressions
— Values
— Operators
— Evaluating Expressions
— Storing Values in Variables
Before we start writing computer games, we should learn some basic programming
concepts first. These concepts are values, operators, expressions, and variables. We won't
start programming in this chapter, but knowing these concepts and the names of things will
make learning to program much easier. This is because most programming is built on only
a few simple concepts combined together to make advanced programs.
Let's start by learning how to use Python's interactive shell.
Some Simple Math Stuff
To open IDLE on Windows, click on Start > Programs > Python 3.1 > IDLE (Python
GUI) . With IDLE open, let's do some simple math with Python. The interactive shell can
work just like a calculator. Type 2+2 into the shell and press the Enter key on your
keyboard. (On some keyboards, this is the RETURN key.) As you can see in Figure 2-1,
the computer should respond with the number 4; the sum of 2+2.
Search WWH ::




Custom Search