Mike Meyer <[EMAIL PROTECTED]> wrote:
> crc <[EMAIL PROTECTED]> writes:
> > I assume your talking about building a new dictionary with the key and
> > value pair switched. I have seen no built in function to do this but I
> > have found a way to create another dictionary that is the inverse of
> >
crc <[EMAIL PROTECTED]> writes:
> I assume your talking about building a new dictionary with the key and
> value pair switched. I have seen no built in function to do this but I
> have found a way to create another dictionary that is the inverse of
> the first.
Note that you can't reliable "revers
I assume your talking about building a new dictionary with the key and
value pair switched. I have seen no built in function to do this but I
have found a way to create another dictionary that is the inverse of
the first.
for example you have designed a dictionary such as
a={}
a['one']=1
a['two'
The end of what I was trying to do was encode and decode using ITA2
International Telegraph Alphabet 2, more commonly called Baudot. It
uses 5 bit binary but with the use of a shift up or a shift down can
utilize 2 tables of 32- one for letters one for figures.
A better explanation of ITA2 here:
[EMAIL PROTECTED] wrote:
> I just started messing with programming and started with Python. Part
> of my first project deals with translating numerical values to letters.
> I would like to be able to do the reverse as well, letters to numbers,
> sort of a table for lookup and a table for reverse l
[EMAIL PROTECTED] wrote:
> What is the difference between
>
> " d1 = {'A' : '1', 'B' : '2', 'C' : '3'} "
>
> and
>
> " d1 = dict(A = 1, B = 2, C = 3) " ?
>
> All of the dictionary examples I saw (python.org, aspn.activestate.com,
> Learning Python by Lutz, among others) use d={'x' : 'y'}.
>
Erik Max Francis <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] wrote:
>> What is the difference between
>> " d1 = {'A' : '1', 'B' : '2', 'C' : '3'} "
>> and
>> " d1 = dict(A = 1, B = 2, C = 3) " ?
>> All of the dictionary examples I saw (python.org,
>> aspn.activestate.com,
>> Learning Python b
Thanks. That is exactly what I meant.
In d2, A is not 'A' because it is being set to 1, whereas in d1, using
A instead of 'A' means A is an undeclared variable instead of a string?
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> What is the difference between
>
> " d1 = {'A' : '1', 'B' : '2', 'C' : '3'} "
>
> and
>
> " d1 = dict(A = 1, B = 2, C = 3) " ?
>
> All of the dictionary examples I saw (python.org, aspn.activestate.com,
> Learning Python by Lutz, among others) use d={'x' : 'y'}.
I
What is the difference between
" d1 = {'A' : '1', 'B' : '2', 'C' : '3'} "
and
" d1 = dict(A = 1, B = 2, C = 3) " ?
All of the dictionary examples I saw (python.org, aspn.activestate.com,
Learning Python by Lutz, among others) use d={'x' : 'y'}.
--
http://mail.python.org/mailman/listinfo/pyt
Thanks so much. That seems to have it. This is the sort of thing I
had before:
#!/usr/local/bin/python
# make a short dictionary
d1 = {'A' : '1', 'B' : '2', 'C' : '3'}
for letter in d1.keys(): print letter, '\t', d1[letter]
# make a space between the output of the 2 dictionaries
print '\n'
[EMAIL PROTECTED] wrote:
> I just started messing with programming and started with Python. Part
> of my first project deals with translating numerical values to letters.
> I would like to be able to do the reverse as well, letters to numbers,
> sort of a table for lookup and a table for reverse l
I just started messing with programming and started with Python. Part
of my first project deals with translating numerical values to letters.
I would like to be able to do the reverse as well, letters to numbers,
sort of a table for lookup and a table for reverse lookup. I thought
that a dictiona
13 matches
Mail list logo