Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #63938

dictionary with tuples

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ikorot01@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.040
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'win32': 0.03; 'python': 0.11; 'dict': 0.16; 'iterable': 0.16; 'typeerror:': 0.16; 'all,': 0.19; 'bit': 0.19; '>>>': 0.22; 'print': 0.22; 'message- id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; '"",': 0.31; 'file': 0.32; '(most': 0.33; 'subject:with': 0.35; 'received:google.com': 0.35; 'doing': 0.36; 'hi,': 0.36; 'thank': 0.38; 'to:addr:python- list': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'you.': 0.62; 'more': 0.64; '2013,': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=RZ6eoOvvmCTAiUAemiZldMoOMNn9mV3ngvcIhCGR0es=; b=riZTSqn5n8XxiJl51BOeG4JN55sh8Ub1qdXFV+fezr4y/TZy2YLUKNEnLkX8F9bscd uvEiZay422kGV6pIULTG51+HHT1XbbsF5OxmCQRY+4EETlGkhKJLa50dTmR3dxD98H+v zQmm11TbKe5uV4abPE4HUbLMFmi0gwSBNWiLHgRGF3jvnj8u5yhcGcoobEO8IDNCpsBa ZL5EzCinr3Jhl32qPrMEmLGJ/19TI5EwU8iU7SMi7JW04oLGqSQey01iWYb6N2dXk0tV P416dHCNutjym9g5/7A6XNFvwTn/ovVnp6zTt71w8wRIs3xSqQDyx8BEa1CprOJL0G0P 5GaQ==
MIME-Version 1.0
X-Received by 10.60.35.73 with SMTP id f9mr2957877oej.50.1389733808108; Tue, 14 Jan 2014 13:10:08 -0800 (PST)
Date Tue, 14 Jan 2014 13:10:07 -0800
Subject dictionary with tuples
From Igor Korot <ikorot01@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5476.1389733811.18130.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1389733811 news.xs4all.nl 2840 [2001:888:2000:d::a6]:60424
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:63938

Show key headers only | View raw


Hi, ALL,
C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> dict = {}
>>> dict[(1,2)] = ('a','b')
>>> dict[(3,4)] = ('c','d')
>>> for (key1,key2),(value1,value2) in dict:
...     print key1, " ", key2
...     print value1, " ", value2
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable
>>>

What am I doing wrong?

Thank you.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

dictionary with tuples Igor Korot <ikorot01@gmail.com> - 2014-01-14 13:10 -0800
  Re: dictionary with tuples YBM <ybmess@nooos.fr.invalid> - 2014-01-14 22:21 +0100
    Re: dictionary with tuples Tobiah <toby@tobiah.org> - 2014-01-14 14:00 -0800
      Re: dictionary with tuples emile <emile@fenx.com> - 2014-01-14 14:14 -0800
      Re: dictionary with tuples YBM <ybmess@nooos.fr.invalid> - 2014-01-15 03:24 +0100

csiph-web