User Tools

Site Tools


python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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://docs.python.org/3/tutorial/introduction.html
 ====== 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 ('...')
 +  * >print('how cool')
 +  * >how cool
 +  * %%Quotes "" or '' will output ticket. If you want quotes you have to do them in ''%%
 +  * >'"yes" he said'
 +
 +
 +=== Special Charactors ===
 +When you want to indicate spaces, or chars that normally are used as an interpreter, put a \ before. As in:
 +  * >'Isn\'t it great'
 +To not interpret \ as a line, put r before quotes
 +  * >pint
 +
 +
 +
python.1481934293.txt.gz ยท Last modified: 2017-03-03 T 17:14 (external edit)