Site icon Hip-Hop Website Design and Development

How to insert "get_template_part()" based on Category ID?

I am trying to insert a part of my template into a Category Archive page.

How would I go about that?

I guess I’d need something like this:

   <?php
    $catarray = get_the_category( $post->ID );
    foreach ($catarray as $cat) {
        $catid = $cat->term_id;

        if ($catid == 10) {
          get_template_part('1','2') << ? 
        }
        if ($catid == 7) {
          get_template_part('3','4') << ?
        }

    }
    ?>