3 0
Sign in to rate

Python - Programming Idioms

0.60MB. 0 audio & 33 images. Updated 2019-11-04.
The author has shared 10 other item(s).


Python code snippets collected from https://www.programming-idioms.org/about#about-block-all-idioms. The deck applies Python syntax to improve the code readability. Example: ------------------------------------------------------- >More decks by pyXelr<

Sample (from 194 notes)

Cards are customizable! When this deck is imported into the desktop program, cards will appear as the deck author has made them. If you'd like to customize what appears on the front and back of a card, you can do so by clicking the Edit button, and then clicking the Cards button.
Front Extract string suffixCreate string t consisting in the 5 last characters of string s
Back 1t = s[-5:]
Tags python3
Front Format date YYYY-MM-DDAssign to string x the value of fields (year, month, day) of date d, in format YYYY-MM-DD
Back 1 2 3from datetime import date d = date(2016, 9, 28) x = d.strftime('%Y-%m-%d') or:1 2 3from datetime import date d = date.today() x = d.isoformat()
Tags python3
Front Find substring positionSet i to the position of string y inside string x, if exists
Back 1i = x.find(y)
Tags python3

After the file is downloaded, double-click on it to open it in the desktop program.

At this time, it is not possible to add shared decks directly to your AnkiWeb account - they need to be added from the desktop then synchronized to AnkiWeb.


on 1616080473

Minor: in night mode some answer's symbols are not visible. But in normal mode - all seems good.
on 1600767267
I'll try it out.
Comment from author
I bet you will. ;)
on 1590306756
Looks nice