Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added examples of assigning multiple values and consecutive values
  • Loading branch information
Hans Sebastian committed Mar 1, 2012
1 parent 75987d5 commit bdf6d03
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions python/test_other_tricks.py
@@ -1,7 +1,21 @@
import types


class TestAssignment(object):
def test_assigning_multiple_values_at_once(self):
raise AssertionError
comics = ('dono', 'kasino', 'indro')
assert len(comics) == 3
x, y, z = comics
assert x == 'dono'
assert y == comics[1]
assert z == 'indro'


def test_assigning_consecutive_values(self):
raise AssertionError
length = 6
my_list = range(length)
assert type(my_list) == types.ListType
a, b, c, d, e, f = range(length)
assert type(a) == types.IntType
assert a == my_list[0]

0 comments on commit bdf6d03

Please sign in to comment.