51 0
Sign in to rate

Python code quiz

0.04MB. 0 audio & 0 images. Updated 2014-04-02.
The author has shared 1 other item(s).


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

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 1675727567
This deck is super helpful in solidifying python intermediate code. Highly recommend!
on 1671812327
How do I create new cards within this deck with the same presentation?
on 1670515723
on 1667891597
This is a well designed deck that forces you to understand the basic rules of python.
I'm a beginner and am finding it very helpful.
on 1664103795
Awesome Work
on 1664055106
Great deck to get into Python
on 1664034727
Very good questions.
on 1658911964
on 1649729921
useful training
on 1646996014
hard but fun and straight forward
on 1643115990
Quick and easy. Thank you
on 1641526273
on 1641232940
advanced and helpful
on 1640174321
Hey, nice!
on 1633469725
Great for studying
on 1625906543
on 1616711983
It could be extended but it is a wonderful collection of situations that can easily bring to an error in python. After the knowledge about python is also improved, especially if you are at an intermediate level.
on 1615580745
Good for beginners in python
on 1611608639
good questions
on 1609389549
The deck is a very good demonstration for question and answer format suitable for Anki. It covers the features of Python language well.
on 1606817279
on 1605955574
If you are learning the basics of Python, some cards in this deck may seem confusing.

These cards are *good* precisely because they are confusing. I've been using Python for a year and still find these cleverly designed cards poking at the gaps in my Python knowledge.

I find this deck extremely helpful.
on 1604541579
on 1598314242
Good way to review the basics
on 1595351457
Very good. Good for solidify the knowledge.
on 1593115589
this set is good for reviewing
on 1589250555
it's quite useful for me to learn more detail about python and help me to avoid the bug
on 1588918268
on 1587304341
very helpful on start
on 1586889591
on 1583557631
I'm not studying python. But this deck is awesome because it shows how to make good flash cards for studying a programming language.
on 1575469595
Great deck!

Have you noticed that:
x = 'hello {{{}}}'.format('world')

Actually displays in anki and ankidroid as

x = 'hello {}}'.format('world')

which is a little confusing!

Edit: I found the fix:
Change the card templates to

{{=<% %>=}}
What does this code output and why?<br><br>


{{=<% %>=}}
<hr id=answer>

the weird string changes the characters used to mark fields from {{ to <%, which doesn't conflict
on 1571988682
on 1570468347
Thanks for sharing this work. It's been really helpful in bettering my understanding of python down to it's nitty gritty. Thanks again for this lovely work.
on 1559018423
Good job
on 1558178190
Cool deck
on 1558042234
very cool
on 1545559866
I never done anything with Python, but i found this deck very useful.
on 1539766704
Great deck.
on 1530412358
quick and useful for brushing up on Python...
on 1522886400
Clear to understand and follow.
on 1515715200
on 1508889600
on 1498348800

This deck is for those who already have a good grasp on basics of Python and want to expand their knowledge to the tiny details of Python. This deck covers many concepts, that are not found in most tutorials.

Kudos to the creator for putting such a good deck together.
on 1496275200
on 1491782400
on 1490486400
on 1474761600
on 1472860800
on 1465776000
This looks excellent

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.
on 1439337600