<div dir="ltr"><div><div><div><div>I want to understand about where to use ,<br></div>viewkeys()<br></div>viewvalues()<br></div>viewitems()<br><br></div>Thanks,<br>santosh<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Feb 26, 2014 at 6:59 PM, Alan Gauld <span dir="ltr"><<a href="mailto:alan.gauld@btinternet.com" target="_blank">alan.gauld@btinternet.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On 26/02/14 07:04, Santosh Kumar wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
I defined a dictionary a below.<br>
<br>
In [14]: a = {'a':1,'b':2,'c':3}<br></div>
...<div class=""><br>
Funtion associated with dictionaries.<br>
<br>
In [11]: print a.viewkeys()<br>
dict_keys(['a', 'c', 'b'])<br>
<br>
In [12]: print a.viewvalues()<br>
dict_values([1, 3, 2])<br>
<br>
In [13]: print a.viewitems()<br>
dict_items([('a', 1), ('c', 3), ('b', 2)])<br>
<br>
Where do i use these , can i get any user cases.<br>
</div></blockquote>
<br>
What is 'these'?<br>
Do you mean:<br>
<br>
1) where do I use a dictionary?<br>
2) where do I use viewXXX()?<br>
3) How do viewXXX differ from XXX (eg a.viewkeys v a.keys)?<br>
<br>
I'm not sure which aspect you want help with?<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Alan G<br>
Author of the Learn to Program web site<br>
<a href="http://www.alan-g.me.uk/" target="_blank">http://www.alan-g.me.uk/</a><br>
<a href="http://www.flickr.com/photos/alangauldphotos" target="_blank">http://www.flickr.com/photos/<u></u>alangauldphotos</a><br>
<br>
______________________________<u></u>_________________<br>
Tutor maillist - <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="https://mail.python.org/mailman/listinfo/tutor" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/tutor</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>D. Santosh Kumar<br>RHCE | SCSA <br>+91-9703206361<br><br><br>Every task has a unpleasant side .. But you must focus on the end result you are producing.<br>
<br>
</div>