What is python?
So, as you can see from the title, this page is about Python, a high level coding language. But what is a high-end coding language? Check out the Computer Science page.
What is a variable?
Before we start, we need to know what a variable is. So, imagine data. All of the data in the program is stored in little squares. By creating a variable, we assign the square a label, and attach some data to it. Wow, that was boring. Don't worry, budding game designer, we'll get to the coding soon!
Stuck? This diagram should help you.
Stuck? This diagram should help you.
There are different types of variables:
- integers - whole numbers
- strings - words
- floats - decimal numbers
Let's Go!
So, once you've downloaded Python from their website and all of that guff, let's start coding!
So, let's start with a variable. Type in: pizza=1. That is a variable! You can use different labels (like curry=1), and even change the value of the variable, like this: pizza=1 <insert lines of code here> pizza=2 |
Did you know...? To a assign a variable to a string (a word), you use speech marks, like this:
pizza="nice" |
Writing stuff
You can use print for words - so if you type in:
print ("Nobody can touch my swag")
print ("Nobody can touch my swag")