skazhy a écrit :
hi, i am new to python, so i've a really simple question about
dictionaries.
if i have a dictionary and I make have an input after it (to input
numbers) can i get the key of value that was in input?
What if many keys are associated with a same value, ie:
d = {'a
On Jul 21, 8:14 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Jeff wrote:
> > throw KeyError('%s not found' % str(val))
>
> "throw"? and shouldn't that be a ValueError? ;-)
>
>
Whoops. Been working in too many different languages at the same
time :).
--
http://mail.python.org/mailman/listinf
On Jul 21, 8:14 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Jeff wrote:
> > throw KeyError('%s not found' % str(val))
>
> "throw"? and shouldn't that be a ValueError? ;-)
>
>
Whoops. Been working in too many different languages at the same
time :).
--
http://mail.python.org/mailman/listinf
Jeff wrote:
throw KeyError('%s not found' % str(val))
"throw"? and shouldn't that be a ValueError? ;-)
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 21, 7:35 am, skazhy <[EMAIL PROTECTED]> wrote:
> hi, i am new to python, so i've a really simple question about
> dictionaries.
> if i have a dictionary and I make have an input after it (to input
> numbers) can i get the key of value that was in input?
>
>
skazhy wrote:
hi, i am new to python, so i've a really simple question about
dictionaries.
if i have a dictionary and I make have an input after it (to input
numbers) can i get the key of value that was in input?
A dictionary contains (key, value) pairs, and is optimized for quickly
fi
Sounds like a school assignment. Find the answer yourself here:
http://diveintopython.org/toc/index.html
You'll learn a lot more in the process.
2B
--
http://mail.python.org/mailman/listinfo/python-list
hi, i am new to python, so i've a really simple question about
dictionaries.
if i have a dictionary and I make have an input after it (to input
numbers) can i get the key of value that was in input?
somehting like this:
dict = { "key1"=100,"key2"=200,"key3"