hey all beginners (newbies). this is for you.
this is so simple, coding a function to do it is not worth it. this code checks to see if all the items in the list named foo are floats. you can the figure out how to test for other types:
this is so simple, coding a function to do it is not worth it. this code checks to see if all the items in the list named foo are floats. you can the figure out how to test for other types:
if min([isinstance(x,float) for x in foo]):this works because the min() builtin function works with booleans, treating False as lower in value than True. you can therefore do other conditions spanning a list or tuple or set. it also works on dictionaries, testing the keys. so here, we test if all the items in the list named foo are equal to the string 'py2' or 'py3'
if min([x in ('py2','py3') for x in foo])enjoy
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.