(Apr-05-2017, 08:17 PM)Sp00f Wrote: can you elaborate on, "any(c.isdigit() for c in flyTo):"
thanks a lot
In slo-mo:
for c in flyTo
in an iterator... it iterates each element offlyTo
. SinceflyTo
is a string the elements are characters
c.isdigit()
is True if c is a digit
for c in flyTo
builds a list of True or False, once for each character
any(some list)
is True if there is at least one element that evaluates to True in the list
any(c.isdigit() for c in flyTo)
evaluates to True is at least one character of flyTo
is a digit.A different way of doing it:
len(flyTo)!=len(flyTo.translate(None,'0123456789'))
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Your one-stop place for all your GIMP needs: gimp-forum.net