Based on 4 ratings:
Sign in to rate
< Back

Python code quiz

0.04MB. 0 audio & 0 images. Updated 2014-04-02.

Description

This deck contains questions about the programming language Python 3. The questions are in a for of a short program, with the output and a short explanation as an answer. It is meant to help people learn the basics of the language. This version of the deck does not yet cover most OOP aspects.

Sample (from 211 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.
Code x = [0, 1, 2, 3] x[::2] = [] print(x)
Output ValueError: attempt to assign sequence of size 0 to extended slice of size 2Extended slices aren't flexible. When assigning to an extended slice, the list on the right hand side of the statement must contain the same number of items as the slice it is replacing.
Tags list python3 remove slice
Code text = 'goodbye cruel world ' words = text.split() print(words)
Output ['goodbye', 'cruel', 'world']By default, string split method uses all white space as a separator
Tags python3 split string
Code def func(): yield 1 yield 2 yield 3 print(type(func)) print(type(func()))
Output <class 'function'><class 'generator'>Function with a yield is a generator function, and returns a generator.
Tags generator python3 yield

Download

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.

Reviews

Write a Review

This looks excellent
Posted on 2016-06-13

So far this is the only Python deck I find usable, and I already learned a few things from it. The content is really good, it ranges from basic behavior to obscure edge cases.

Some cards would probably be better as cloze cards, but it's a great deck that you can extend yourself. Programming languages can't be learned through a deck, so you should at least have some Python experience before you start.