Is there something like enumerate in python target?

Is there something like enumerate in python target?

 for count, value in enumerate(values):
...     print(count, value)

I try to use Map to do that ?but python target not work.

Having an array of values, as in the example you have given, there’s no need for anything like the enumerate method.

If you just want to print out the index for each value in a for loop:

	final values = ['a', 'b', 'c'];
	// trace value and index
	for (idx => value in values)
		trace('$idx: $value');

If you want to create map of values with index as key:

	// create a map of index => value
	final valueMap:haxe.ds.IntMap<String> = new haxe.ds.IntMap();
	for (idx => value in values)
		valueMap.set(idx, value);

or

	final valueMap:haxe.ds.IntMap<String> = 
		[for (idx => value in values) idx => value];