You could use:
<?php $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); if(has_category()) { echo $categories_list; } ?>
Here’s the has_category function via the Codex.
You could use:
<?php $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); if(has_category()) { echo $categories_list; } ?>
Here’s the has_category function via the Codex.