[PDF] [PDF] Python 3 Cheat Sheet - LIMSI

Python 3 Cheat Sheet ©2012-2015 - Laurent Pointal License Creative Commons Attribution 4 Latest version on : https://perso limsi fr/pointal/python: memento



Previous PDF Next PDF





[PDF] Vim cheat sheet wallpaper - Squarespace

command line? How about using desktop backgrounds that also double as cheat sheets? After all Linux command cheat sheets often put it at hand If you ask 



[PDF] Vim cheat sheet wallpaper - Weebly

backgrounds that also double as cheat cheats? After all, Linux cheat sheet commands often come in handy If you ask me, I'm a fan of cheat sheet, but not as  



[PDF] vi Editor “Cheat Sheet”

VI “Cheat” Sheet ACNS Bulletin ED–03 February 1995 File management commands :w name Write edit buffer to file name :wq Write to file and quit :q



[PDF] Windows Command Prompt Cheatsheet

Windows Command Prompt Cheatsheet - Command line interface (as opposed to a GUI - graphical user interface) - Used to execute programs - Commands 



[PDF] Red Hat Linux Commands Cheat Sheet

14 jan 2021 · linux wallpapers that are also cheat sheets it, the linux command line cheat sheet network world, redhat cheat sheets cheatography com cheat sheets for,



[PDF] docker cheat sheet

Docker Cheat Sheet Build Build an image from the Dockerfile in the current directory and tag the image docker build -t myimage:1 0 List all images that are  



[PDF] GNU Emacs Reference Card - GNUorg

abort partially typed or executing command C-g recover files lost by a system crash M-x recover-session undo an unwanted change C-x u, C-_ or C-/ restore a  



[PDF] Kali Linux Revealed Book

7 results · 3 2 2 Command Line Basics: Browsing the Directory Tree and Managing Files Heck, you could even throw in a custom wallpaper with a Microsoft 



[PDF] Python 3 Cheat Sheet - LIMSI

Python 3 Cheat Sheet ©2012-2015 - Laurent Pointal License Creative Commons Attribution 4 Latest version on : https://perso limsi fr/pointal/python: memento

[PDF] linux command line and shell scripting bible

[PDF] linux commands cheat sheet 2016 pdf

[PDF] linux commands for deployment

[PDF] linux directories cheat sheet

[PDF] linux essentials labs

[PDF] linux essentials practice exam

[PDF] linux fopen exclusive access

[PDF] linux network commands cheat sheet pdf

[PDF] linux objectives

[PDF] linux plus book

[PDF] linux shell scripting cheat sheet pdf

[PDF] linux top cheat sheet

[PDF] list and arraylist in java

[PDF] list countries by time zone

[PDF] list of 2d shapes and their properties pdf

Sequence Containers IndexingBase TypesPython 3 Cheat Sheet©2012-2015 - Laurent Pointal License Creative Commons Attribution 4Latest version on :

0783-192int

9.23-1.7e-60.0float

TrueFalsebool

"One\nTwo" 'I\'m'str"""X\tY\tZ1\t2\t3"""×10-6 escaped tabescaped new lineMultiline string:Container Types list[1,5,9]["x",11,8.9]["mot"][] tuple(1,5,9)11,"y",7.4("mot",)() set{} {1,9,3,0}◾ ordered sequences, fast index access, repeatable values set()◾ key containers, no a priori order, fast key access, each key is unique {"key1","key2"}Non modiifiable values (immutables)

Variables assignment

x=1.2+8+sin(y) y,z,r=9.2,-7.6,0 a...zA...Z_ followed by a...zA...Z_0...9 ◽ diacritics allowed but should be avoided ◽ language keywords forbidden ◽ lower/UPPER case discrimination☝ expression with only comas →tuple dictionary collectioninteger, lfloat, boolean, string, bytes

Identiifiers

☺ a toto x7 y_max BigOne☹ 8y and for x+=3 x-=2increment ⇔ x=x+3 decrement ⇔ x=x-2Conversions for lists, tuples, strings, bytes... int("15") → 15 int("3f",16) → 63can specify integer number base in 2nd parameter int(15.56) → 15truncate decimal part float("-11.24e8") → -1124000000.0 round(15.56,1)→ 15.6rounding to 1 decimal (0 decimal → integer number) bool(x)False for null x, empty container x , None or False x ; True for other x str(x)→ "..."representation string of x for display (cf. formatting on the back) chr(64)→'@'ord('@')→64code ↔ char repr(x)→ "..."literal representation string of x bytes([72,9,64]) → b'H\t@' list("abc") → ['a','b','c'] dict([(3,"three"),(1,"one")]) → {1:'one',3:'three'} set(["one","two"]) → {'one','two'} separator str and sequence of str → assembled str ':'.join(['toto','12','pswd']) → 'toto:12:pswd' str splitted on whitespaces → list of str "words with spaces".split() → ['words','with','spaces'] str splitted on separator str → list of str "1,4,8,2".split(",") → ['1','4','8','2'] sequence of one type → list of another type (via list comprehension) [int(x) for x in ('1','29','-3')] → [1,29,-3]type(expression) lst=[10, 20, 30, 40, 50]lst[1]→20 lst[-2]→4001234-5-4-3-1-2Individual access to items via lst[index] positive indexnegative index

012354

-5-4-3-1-2negative slicepositive slice Access to sub-sequences via lst[start slice:end slice:step]len(lst)→5 lst[1:3]→[20,30] lst[:]→[10,20,30,40,50] Missing slice indication → from start / up to end. On mutable sequences (list), remove with del lst[3:5] and modify with assignment lst[1:4]=[15,25]

Conditional Statement

if age<=18: state="Kid" elif age>65: state="Retired" else: state="Active"Boolean LogicStatements Blocks parent statement: statement block 1... parent statement: statement block2... a and b a or b not alogical and logical or logical notone or other or bothboth simulta- -neously if logical condition: statements blockstatement block executed only if a condition is true

Can go with several elif, elif... and only one

ifinal else. Only the block of ifirst true condition is executed.lst[-1]→50lst[0]→10 ⇒ last one⇒ ifirst onex=None" undeifined » constant value Maths

Operators: + - * / // % **×÷

integer ÷÷ remainderabfrom math import sin,pi... sin(pi/4)→0.707... cos(2*pi/3)→-0.4999... log(e**2)→2.0 ceil(12.5)→13 floor(12.5)→12escaped ' ☝ lfloating numbers... approximated valuesangles in radians (1+5.3)*2→12.6abs(-3.2)→3.2 round(3.57,1)→3.6pow(4,3)→64.0for variables, functions, modules, classes... namesMémento v2.0.6 str(ordered sequences of chars / bytes) (key/value associations) ☝ pitfall : and and or return value of a or of b (under shortcut evaluation). ⇒ ensure that a and b are booleans.(boolean results)a=b=c=0assignment to same value multiple assignments a,b=b,avalues swap a,*b=seq *a,b=sequnpacking of sequence in item and listbytesbytes b"toto\xfe\775" emptydict(a=3,b=4,k="v")quotesdbs_dbs3.pdfusesText_6