So you want a string of some attribute in account, for instance, the account name?
if $AccountNames != empty
then $AccountNames + ',' + $IteratorAccount/Name
else $IteratorAccount/Name
After you're done looping, you'll have a comma separated string of all your account names. Adjust as needed if you need a different string.
In addition to Eline’s answer, if you need the Count of $AccountList to be a string, and assuming you called this value $AccountCount, you can use the following when you create a new String variable.
toString($AccountCount)
https://docs.mendix.com/refguide/to-string