User Tools

Site Tools


python

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
python [2016-12-17 T 00:31]
admin
python [2017-03-03 T 17:14] (current)
Line 9: Line 9:
 ==== Some basics ==== ==== Some basics ====
   * #is the comment operator   * #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.1481934680.txt.gz ยท Last modified: 2017-03-03 T 17:14 (external edit)