Supposing your dictionary like this: dict={1:'My name is X',2:'My name is x
y z',3: 'i am X'}
You can use len(list) :
>>> dict={1:'My name is X',2:'My name is x y z',3: 'i am X'}
>>> for values in dict.values():
... if len(values.split(' '))>3:
... print values
My name is X
My name is x y z
On Fri, May 6, 2011 at 7:56 AM, louis leichtnam <[email protected]>wrote:
> HEllo everyone,
>
> I have a dictionnary, and I would like to print only the values that have
> more/equal than 3 spaces in them for example: My name is Xavier.
>
> Can you help me out,
>
> Thanks
>
> Louis
>
> _______________________________________________
> Tutor maillist - [email protected]
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor