Check whether a group layer is empty or not

Discussion created by ranam80 on Jan 10, 2014
Latest reply on Jan 14, 2014 by ranam80

I have an mxd file with around 100 layers and group layers. I'm trying to loop through all group layers and find out if they're empty or not (contains Feature class(es) or not). If a group layer is empty, I want to remove that group layer from the map.

I found the script to remove the group layer, but I couldn't figure out how to check if the group layer is empty or not

Anyone can help?
Thank you