Python beginner looking for feedback on simple dice game Dice &quot;Game&quot;
So, just started python a weeks time ago, so I'm looking for feedback/critique on things i can do to improve my code. I wrote a little user/pc dice rolling game. Any feedback at all is appreciated!


def dice(n: int) -&gt; tuple:
    &quot;&quot;&quot;
    Simple function to roll 'n' number of dices.
    Returns numbers of each roll and a total.

    :param n: number of dices to roll
    :return: dices_numbers, total
    &quot;&quot;&quot;
    numbers = []
    total = 0
    for dices in range(n):
        number = random.randint(1, 6)
        numbers.append(number)
        total += number
    dices_numbers = &quot;, &quot;.join(map(str, numbers))
    return dices_numbers, total


def dice_check(user_total: int = 0, pc_total: int = 0) -&gt; None:
    &quot;&quot;&quot;
    Function to check whether user or pc won dice roll.

    :param user_total: user's total roll
    :param pc_total:  pc's total roll
    :return: None
    &quot;&quot;&quot;
    if user_total &gt; pc_total:
        print(&quot;Congratulations! You won&quot;)
    elif user_total &lt; pc_total:
        print(&quot;Sorry, BOT wins!&quot;)
    else:
        print(&quot;Tie!&quot;)


number_of_dices = &quot;&quot;
user_roll = &quot;&quot;
pc_roll = &quot;&quot;
while True:
    number_of_dices = int(input(&quot;How many dices would you like to roll?&quot;
                                &quot; (0 to quit) &gt;&quot;))
    if number_of_dices == 0:
        break
    else:
        user_roll = dice(number_of_dices)
        pc_roll = dice(number_of_dices)
        print(f&quot;You: Roll: {user_roll[0]}, a total of: {user_roll[1]}&quot;)
        print(f&quot;BOT: Roll: {pc_roll[0]}, a total of: {pc_roll[1]}&quot;)
        dice_check(user_roll[1], pc_roll[1])
I'm pretty new as well, but I like to create an exception whenever I try to convert user input to an integer. Something like this-
while True:
    try:
        number_of_dices = int(input(&quot;How many dices would you like to roll?&quot;
                                    &quot; (0 to quit) &gt;&quot;))
    except ValueError:
        print(&quot;Please enter a number.&quot;)