Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
python [2019/03/31 21:01] 127.0.0.1 external edit |
python [2019/07/09 17:29] (current) paul [Formatting] |
||
---|---|---|---|
Line 169: | Line 169: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | |||
+ | ==== Formatting ==== | ||
+ | |||
+ | If you want to print a neat line of data use the [[https:// | ||
+ | |||
+ | For example: | ||
+ | <code python> | ||
+ | print(" | ||
+ | </ | ||
+ | |||
+ | This sets a fix width for each field and aligns the test either left '' | ||
===== Mutability ===== | ===== Mutability ===== | ||
Line 266: | Line 277: | ||
You can assign lists uisng text parallel assignment | You can assign lists uisng text parallel assignment | ||
<code python> | <code python> | ||
- | firstname, lastname = ["Dildo", " | + | firstname, lastname = ["Bilbo", " |
</ | </ | ||
- | God python is so wierd with shit, like, theres | + | God python is so wierd with shit, like, there' |
everywhere. Haha. | everywhere. Haha. | ||
Line 305: | Line 316: | ||
t = (1,2,3) | t = (1,2,3) | ||
l = list(t) | l = list(t) | ||
- | l.append(" | + | l.append(" |
t = tuple(l) | t = tuple(l) | ||
</ | </ |