|
| 1 | +# What is programming? |
| 2 | + |
| 3 | +**Feel free to [skip this part](#how-to-read-this-tutorial) if you already |
| 4 | +know everything it's talking about.** |
| 5 | + |
| 6 | +As a computer user you know that computers don't have feelings. They don't |
| 7 | +work any faster or slower depending on if you're angry at them or if you're |
| 8 | +happy. Computers can perform millions of calculations per second, but they |
| 9 | +require you to tell them exactly what to do. If they do something else than |
| 10 | +you want them to do the problem is usually that they don't understand your |
| 11 | +instructions the way you understand them. |
| 12 | + |
| 13 | +The only big difference between programming and what you're familiar with |
| 14 | +already is that instead of clicking buttons to do things we write the |
| 15 | +instructions using a **programming language**. Most programming languages |
| 16 | +consist of English words, digits and some characters that have special |
| 17 | +meanings. This tutorial uses a programming language called Python because it's |
| 18 | +easy to learn and you can do many different things with it. For example, you |
| 19 | +can create your own applications that have buttons that people can click |
| 20 | +instead of just using applications written by others. |
| 21 | + |
| 22 | +Before we can get started with Python you need to know how to write some of |
| 23 | +Python's special characters with your keyboard. Unfortunately I don't know |
| 24 | +which keys you need to press to produce these characters because your keyboard |
| 25 | +is probably different than mine. But the keyboard can tell what you |
| 26 | +need to press. For example, my Finnish keyboard has a key like this: |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +Here's what the characters on this key mean: |
| 31 | + |
| 32 | +- I can type a number 7 by pressing this key without holding down other keys |
| 33 | + at the same time. |
| 34 | +- I can type a `/` character by holding down the shift key (on the left edge |
| 35 | + of the keyboard, between Ctrl and CapsLock) and pressing this key. |
| 36 | +- I can type a `{` character by holding down AltGr (on the bottom of the |
| 37 | + keyboard, on the right side of the spacebar) and pressing this key. |
| 38 | + Holding down Ctrl and Alt instead of AltGr may also work. |
| 39 | + |
| 40 | +The only key that doesn't have anything written on it is spacebar. It's the |
| 41 | +big, wide key that's closest to you. Another key that's used for producing |
| 42 | +whitespace is tab, the key above CapsLock. |
| 43 | + |
| 44 | +In this tutorial we need to know how to type these characters. We'll learn |
| 45 | +their meanings later. |
| 46 | + |
| 47 | +| Character | Names | |
| 48 | +|-----------|---------------------------------------| |
| 49 | +| `+` | plus | |
| 50 | +| `-` | minus, dash, hyphen | |
| 51 | +| `_` | underscore | |
| 52 | +| `*` | star, asterisk | |
| 53 | +| `/` | forwardslash (it's leaning forward) | |
| 54 | +| `\` | backslash (it's leaning back) | |
| 55 | +| `=` | equals sign | |
| 56 | +| `%` | percent sign | |
| 57 | +| `.` | dot | |
| 58 | +| `,` | comma | |
| 59 | +| `:` | colon | |
| 60 | +| `?` | question mark | |
| 61 | +| `!` | exclamation mark | |
| 62 | +| `<` `>` | less-than and greater-than signs | |
| 63 | +| `'` `"` | single quote and double quote | |
| 64 | +| `#` | hashtag | |
| 65 | +| `()` | parentheses | |
| 66 | +| `[]` | square brackets, brackets | |
| 67 | +| `{}` | curly braces, braces, curly brackets | |
| 68 | + |
| 69 | +That may seem like many characters, but you probably know many of them already |
| 70 | +so it shouldn't be a problem. |
| 71 | + |
| 72 | +## How to read this tutorial |
| 73 | + |
| 74 | +I've done my best to make this tutorial as easy to follow as possible. Other |
| 75 | +people have commented on this and helped me improve this a lot also. But what |
| 76 | +should you do if you have a problem with the tutorial? |
| 77 | + |
| 78 | +1. Try the example code yourself. |
| 79 | +2. Read the code and the explanation for it again. |
| 80 | +3. If there's something you haven't seen before in the tutorial and it's |
| 81 | + not explained, try to find it from the previous chapters. |
| 82 | +4. If you still have trouble understanding the tutorial or any other problems |
| 83 | + with the tutorial, please [tell me about it](contact-me.md). I want to |
| 84 | + improve this tutorial so other readers won't have the same problem as you |
| 85 | + have. |
| 86 | +5. See [Getting help](getting-help.md) if you can't contact me for some |
| 87 | + reason. |
| 88 | + |
| 89 | +You are free to combine this tutorial with other learning resources. If this |
| 90 | +tutorial isn't exactly what you're looking for you don't need to stick with |
| 91 | +nothing but this. You can find another tutorial and mix the tutorials however |
| 92 | +you want as long as you **make sure that you understand everything you read**. |
| 93 | + |
| 94 | +One of the most important things with learning to program is to **not |
| 95 | +fear mistakes**. If you make a mistake, your computer will not break in |
| 96 | +any way. You'll get an error message that tells you what's wrong and |
| 97 | +where. Even professional programmers do mistakes and get error messages |
| 98 | +all the time, and there's nothing wrong with it. |
| 99 | + |
| 100 | +Even though a good tutorial is an important part about learning to |
| 101 | +program, you also need to learn to make your own things. Use what you |
| 102 | +have learned, and create something with it. |
| 103 | + |
| 104 | +## Summary |
| 105 | + |
| 106 | +- Now you should know what programming and programming languages are. |
| 107 | +- You don't need to remember how to type different characters. Just find the |
| 108 | + character on your keyboard and press the key, holding down shift or AltGr |
| 109 | + as needed. |
| 110 | +- Make sure you understand everything you read. |
| 111 | +- Don't fear mistakes. |
| 112 | +- Error messages are your friends. |
| 113 | +- Let me know if you have trouble with this tutorial. |
| 114 | +- Now we're ready to [install Python](installing-python.md) and |
| 115 | + [get started](getting-started.md)! |
| 116 | + |
| 117 | +*** |
| 118 | + |
| 119 | +You may use this tutorial at your own risk. See [LICENSE](LICENSE). |
0 commit comments