Recognizing the data type of list-elements
I have a list containing integers and strings. Is there any way to find out, which element is
from which type?
something like:
if myList{i} == <????>: print "its a string"
else print "its an integer"
|
breve: a 3d Simulation Environment for Multi-Agent Simulations and Artificial Life |
|
NavigationUser loginActive forum topicsSearch |
Recognizing the data type of list-elementsI have a list containing integers and strings. Is there any way to find out, which element is something like: if myList{i} == <????>: print "its a string" |
added for 2.5
This functionality was missing, but I've added it for version 2.5. I hope to make another beta build in the next couple of days.
- jon
That would be great. I hope
That would be great. I hope you shot a big signal-rocket, if this build is ready. I need really need that functionality.
Try this...
Try the new "typeof()" operator in this build. It returns a string indicating the type of a value, so typeof( "x" ) = "string".
http://spiderland.org/breve_2.5b
- jon
Thx a bunch Jon!
Thx a bunch Jon!