Академический Документы
Профессиональный Документы
Культура Документы
First things first: go through the Python tutorial. Yes, you will spend a few minutes of your life printing
out 1+1. But you will also discover some tricks that will save you time over the course of the semester.
It’s worth the investment.
In the spirit of helping people get a quicker start…here is an attempt at giving you some basic rules and
some gotchas to avoid.
1. Python uses indenting rather than braces to indicate that a statement is inside a
method/loop/what-have-you
2. You can use either spaces or tabs to indent, but you *should not* mix them (it may result in
either errors or crazy misinterpretations of your code). When you copy things from webpages or
else where you may find you need to fix the indenting.
3. Semi colons aren’t required
4. There’s no difference between “ and ‘
5. There’s no static typing, so you don’t have to declare what something is, you just use it. Note:
there’s one exception here. If you want to use a global variable then you need to declare it (see
tutorial for more info)
A few basics: