indar kumar <indarkuma...@gmail.com> writes: > On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote: >> Hi, >> >> >> >> I want to show a code for review but afraid of plagiarism issues. >> Kindly, suggest how can I post it for review here without masking it >> visible for public > > Can I do the following to just get the value as string not the type list? > > searchfor = '192.168.0.2' > z=[ii[0] for ii in hosts.values() if ii[1] == searchfor] >>>> str1 = ''.join(z) >>>> str1
If you want to extract an element of a list use indexing, like mylist[0]. If you don't know these things or can't find this out yourself, you have a serious lack of knowledge about Python, or maybe about programming, and it is time to learn that first. -- Piet van Oostrum <p...@vanoostrum.org> WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list