This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
python [2016-12-17 T 00:24] admin created |
python [2017-03-03 T 17:14] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | Work in Progress | ||
+ | \\ Current tuturial: https:// | ||
====== Python ====== | ====== Python ====== | ||
Python is a powerful coding tool. there are many ways to start python or write in python. | Python is a powerful coding tool. there are many ways to start python or write in python. | ||
Line 4: | Line 7: | ||
* This will start the python comand console | * This will start the python comand console | ||
* Ctl+D to exit (like ctl+C for bash) | * Ctl+D to exit (like ctl+C for bash) | ||
+ | ==== Some basics ==== | ||
+ | * #is the comment operator | ||
+ | |||
+ | === value types === | ||
+ | * int | ||
+ | * float | ||
+ | * (more on this another time) | ||
+ | |||
+ | === assign variables === | ||
+ | Can do simple variable subs with = | ||
+ | * >widht = 20 | ||
+ | * >height = 20 | ||
+ | * >width * height | ||
+ | * 400 | ||
+ | Also you can create multple assingments with , in both sides of = | ||
+ | * >a, b = 0, 1 | ||
+ | === Output text === | ||
+ | There are a lot of rules about printing text. Here are some basics. | ||
+ | * print is the most common command, and followed by (' | ||
+ | * > | ||
+ | * >how cool | ||
+ | * %%Quotes "" | ||
+ | * >'" | ||
+ | |||
+ | |||
+ | === Special Charactors === | ||
+ | When you want to indicate spaces, or chars that normally are used as an interpreter, | ||
+ | * >' | ||
+ | To not interpret \ as a line, put r before quotes | ||
+ | * >pint | ||
+ | |||
+ | |||
+ |